From 38a9438713cd3b4a7787f582bfb9762c1809eddf Mon Sep 17 00:00:00 2001 From: Tracreed Date: Thu, 28 Dec 2017 12:25:14 +0100 Subject: [PATCH] fuck engo --- engo/TrafficManager/assets/city.png | Bin 0 -> 24916 bytes engo/TrafficManager/systems/citySystem.go | 86 ++++++++++++++++++++++ engo/TrafficManager/traffic.go | 47 ++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 engo/TrafficManager/assets/city.png create mode 100644 engo/TrafficManager/systems/citySystem.go create mode 100644 engo/TrafficManager/traffic.go diff --git a/engo/TrafficManager/assets/city.png b/engo/TrafficManager/assets/city.png new file mode 100644 index 0000000000000000000000000000000000000000..577cf37e84c56089f7353362b2336ad1093dd6d9 GIT binary patch literal 24916 zcmXt9WmHt(*S-t`4ka^4kNkikM7jh7=~TK~Qjl(t9uaV85NQeN?nXko5s+?>?rwPJ z|KYuB-4Ao_taH!K`|N$56QZIdOMpv>3jhGYTRAB;0Knh?0MKU$2t5)a(HIT@xRO?q zk}7W{C21U;9W1PDKLEg|*;I88o!CoKk)_KIgjy2QM->USp8*72F{Br&n+g2}m;^$J z#JYk|xLU*{upe@oodFZLa;d1*45oTZ@lcdrn5Kci0rh-djjz|?{{HRM?XS%rn|H&W zBZNp85o63orZwMRMuF*>j^pXSR>Q&~rz;^(!_4JWI0EGm= z-q~9bEMU4IcAgBF&U{_~0U|JfBqmvUkXRF7tod1u71Y)aWE6`b*uib37)ae(Zdnkr z84GZa)QKh(GX{`J60Cy&jQ|Lc{O{QiCXE7S2IpAoa)FU!P`w-m&^8b^lpsIGLtG#C zhtlKZXnB=(wcWNt!i4N4)B@)p;zvRX-7~pOOod^50HC}c{rw;y8ojykZ)L+`)AsPJ zEAzqT$N?cjd%X1UD;xv{ph_c$vqtOdlbDV@80BuQHU;{?tQPQb>DrKI4ktqo_m9_g zn5V#<*neq1ReIl0J;%kv+h;KS+03~XCi2L$;;F89e-jtCJ^k^U>Q@^X$OKzT44=O34O9aAAM!cw zPx5$i3X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cf_ey zkS~(?nN4XpRIo7?wxZiSxQNXDRMHUhQiqk|Vx}vySj!a}F+jn6xcNZ4)y;+P7X&U* zWwybIo74zD16xrdBp>XCMJN&kKelj3zn+G96SyIDnrFDWT$BvarB^Ws8j;=AGnef8 zq0yh+E$!_(1C7;(MyKCoKx%mcl??x`$);X%I!i?C{{t7HX0KQ zw?DndqsU7c6F@JaON>GxRFU7cpx-T;sK2Uy~(5&UtyWMz&@88hC`f-4jC z@$Wdb`YzAo*V@q8Qnq}{)l0ZIQ)k?FT*d>rbN4edy%j!js&!v~v3*}`ReZ@I-;H*s zK_Ec-lcGe2iB8S9SiYmXKXyFyoTtd#WTZ!Tipj?wQPN!fKPRXYh3D^Y($QPfKMZ%m z4-Akc%3Mx224^cryh~CK>Qowu22CW<#8=(xV}+rbZS#M3M#5rMdY}T~ygcnxZQNK?IY#K(H@vvq8Q&3g+bCSJiH>LY zwHFfxe485^A0%G(aKOpsa3i*0(ZsTKjwJ8AP5RMUyKSR|ZnWdTzvPPnh_#f%XIcUM zEm~}(qnBYcwWe0E=#QM2kABvFD3zVPnZ_9~M<2|8yQ-t4;_)w%5U!H1Np-Dt&RE05 zxHNNcV@6GFZJFkxYp_?#_pwtd&pjVbdB2xnXTX&k>k`#zp=?@fm(`j`t1%O2ultuY zbJ_A}JD?5}{mmbqZY)z|$ufo5EzwKRc)atazKHcx_~A(Rd0oL4t#J882tChjv(=Rh z(L|yxgKKc3d87K;=w`jLO#*pz=yS-oTdu`+N@)>s4-Gn)puDp6H0iF1 z%xzj&^Gezcr`Oo)3>2DxL*xq?KW5Qq4XL=K6@G<+vyFV5g-v&PAbR5c>Hex)XQ8y= vFQ>}c>`v3To_@%uG+}pzM$7rZ5yN2ZE}6!Yy&d$mrMahRpi!ds@Y(+X@ybuz literal 0 HcmV?d00001 diff --git a/engo/TrafficManager/systems/citySystem.go b/engo/TrafficManager/systems/citySystem.go new file mode 100644 index 0000000..b1ddfaf --- /dev/null +++ b/engo/TrafficManager/systems/citySystem.go @@ -0,0 +1,86 @@ +package systems + +import ( + "engo.io/ecs" + "engo.io/engo" + "engo.io/engo/common" + "fmt" + "log" +) + +type System interface { + // Update is ran every frame, with `dt` being the time + // in seconds since the last frame + Update(dt float32) + + // Remove removes an Entity from the System + Remove(ecs.BasicEntity) +} + +type City struct { + ecs.BasicEntity + common.RenderComponent + common.SpaceComponent +} + +type MouseTracker struct { + ecs.BasicEntity + common.MouseComponent +} + +type CityBuildingSystem struct { + mouseTracker MouseTracker + + world *ecs.World +} + +// Remove is called whenever an Entity is removed from the World, in order to remove it from this sytem as well +func (*CityBuildingSystem) Remove(ecs.BasicEntity) {} + +// Update is ran every frame, with `dt` being the time +// in seconds since the last frame +func (cb *CityBuildingSystem) Update(dt float32) { + if engo.Input.Button("AddCity").JustPressed() { + fmt.Println("The gamer pressed F1") + + city := City{BasicEntity: ecs.NewBasic()} + + city.SpaceComponent = common.SpaceComponent{ + Position: engo.Point{cb.mouseTracker.MouseX, cb.mouseTracker.MouseY}, + Width: 30, + Height: 64, + } + + texture, err := common.LoadedSprite("textures/city.png") + if err != nil { + log.Println("Unable to load texture: " + err.Error()) + } + + city.RenderComponent = common.RenderComponent{ + Drawable: texture, + Scale: engo.Point{X: 0.1, Y: 0.1}, + } + + for _, system := range cb.world.Systems() { + switch sys := system.(type) { + case *common.RenderSystem: + sys.Add(&city.BasicEntity, &city.RenderComponent, &city.SpaceComponent) + } + } + } +} + +func (cb *CityBuildingSystem) New(w *ecs.World) { + cb.world = w + fmt.Println("CityBuildingSystem was added to the Scene") + + cb.mouseTracker.BasicEntity = ecs.NewBasic() + cb.mouseTracker.MouseComponent = common.MouseComponent{Track: true} + + for _, system := range w.Systems() { + switch sys := system.(type) { + case *common.MouseSystem: + sys.Add(&cb.mouseTracker.BasicEntity, &cb.mouseTracker.MouseComponent, nil, nil) + } + } +} \ No newline at end of file diff --git a/engo/TrafficManager/traffic.go b/engo/TrafficManager/traffic.go new file mode 100644 index 0000000..65aa2b7 --- /dev/null +++ b/engo/TrafficManager/traffic.go @@ -0,0 +1,47 @@ +package main + +import ( + "engo.io/engo" + "engo.io/engo/common" + "engo.io/ecs" + "image/color" + "./systems" +) + +type myScene struct {} + +type City struct { + ecs.BasicEntity + common.RenderComponent + common.SpaceComponent +} + + +// Type uniquely defines your game type +func (*myScene) Type() string { return "myGame" } + +// Preload is called before loading any assets from the disk, +// to allow you to register / queue them +func (*myScene) Preload() { + engo.Files.Load("city.png") +} + +// Setup is called before the main loop starts. It allows you +// to add entities and systems to your Scene. +func (*myScene) Setup(world *ecs.World) { + engo.Input.RegisterButton("AddCity", engo.F1) + common.SetBackground(color.White) + world.AddSystem(&common.RenderSystem{}) + world.AddSystem(&common.MouseSystem{}) + + world.AddSystem(&systems.CityBuildingSystem{}) +} + +func main() { + opts := engo.RunOptions{ + Title: "Hello World", + Width: 400, + Height: 400, + } + engo.Run(opts, &myScene{}) +} \ No newline at end of file