From b76bcd53e2196e00634093a56d5b6e3f45f7ebd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCbner?= Date: Wed, 9 Aug 2017 22:54:24 +0200 Subject: [PATCH] hmm --- Bullet.gd | 2 +- Drawer.gd | 4 ++++ Minimap.gd | 10 ++++++++-- raw/minimap.ase | 4 ++-- raw/minimap.png | Bin 820 -> 832 bytes 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Bullet.gd b/Bullet.gd index 8991070..3e1be9c 100644 --- a/Bullet.gd +++ b/Bullet.gd @@ -13,7 +13,7 @@ func fire(delta, vel, dir, speed): sprite.rotate(dir.angle()) func type(): - return "Enemy" + return "Bullet" func _fixed_process(delta): diff --git a/Drawer.gd b/Drawer.gd index 96af121..06e7f8e 100644 --- a/Drawer.gd +++ b/Drawer.gd @@ -19,8 +19,12 @@ func _draw(): var p_mw = ((vp_rect.size.x / 2) - 1) + 32 var p_mh = ((vp_rect.size.y / 2) - 1) + 32 draw_rect(Rect2(p_mw, p_mh, 2, 2), Color(0, 1, 0)) + for e in entities: var ent = e.get_ref() + if ent == null: + continue + var ent_pos = ent.get_global_pos() var s_mw = vp_rect.size.x / 2 var s_mh = vp_rect.size.y / 2 diff --git a/Minimap.gd b/Minimap.gd index 9a9e402..7a2a401 100644 --- a/Minimap.gd +++ b/Minimap.gd @@ -22,9 +22,15 @@ func collect_entities(): for i in range(0, entities.size()): if not entities[i].get_ref(): if to_remove == null: + print ("create") to_remove = Array() - to_remove.push_back(i) - + to_remove.push_back(entities[i]) + # pass down updated + if to_remove != null: + for e in to_remove: + entities.erase(e) + render_target.init(entities) + func _fixed_process(delta): collect_entities() diff --git a/raw/minimap.ase b/raw/minimap.ase index f7c4026..ca24876 100644 --- a/raw/minimap.ase +++ b/raw/minimap.ase @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4ee2a229e536843a7614db4df999ffb22a4dd382176d4dd24a333870dcd8304 -size 1047 +oid sha256:a093996494d981df991982202a4fd54d6c47d91caddf56f7debdc1b831a65e32 +size 1046 diff --git a/raw/minimap.png b/raw/minimap.png index 14c44aad1b11408e81faf3bfeb4c063588671a6b..9d5e6f41650af78abfd59d27601266aca84b177f 100644 GIT binary patch literal 832 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU}pDpaSW-L^Y+%pyjuYx?H`@5 z&gA4YRIE%${5a>Vkp2bsQ&-qeal0hFJ~K(RSyheuq_Dn2+pC}?r=9<9AAPs;e*R{m zrlXdI^99ow8eDw!_`_bG)qLjoK7ak>-}_tLgP(oh`}6QkrQffcU$5$^Q?iLW^G7dM z*WtSQf&Wi$Ur=vI+{n!Z7{t|F4hJmkT>u`|F>d z_SE&cYDTTJMRbZ;bP7*>!b8*ZpAPl4|E<)^E&V6c@Q{Cb|Mh)eqYs2{7m}D~C2q&* zGv`k&L*CzGu5-D=8;)FL@Vme;;lju!d9E=4gEIC%i%adEZ)?RDtn*sE`qHw`OQ-J6 z%~x+KJCq&wZkyR${qx0{tAQc8bOTFd+y)kAj>GR4U1pkbbGbI7-0IgK&PM4uOcRgK zi=8H(_U(C?3Jd4)eoH=3Oo(l?Gd+;C*Ya*PP{AF>o`5$WW*g5lsh8OHT2AlxW1-*k zkftfdM|9Ftan8a37Dc|`qVy(IQ fKSxG}iFOPVFPJ-++^zKn<_rc;S3j3^P60-~7D)(1j^KYxC`PM5NZ&7R64zsNeGN=$ZG|?lP6sGX9C* z*ZY^vKu=7eP{-j>M8lDd44v7vq5@OeYv;dbmQAfxw0)n)_-a*6)yixkcab@vCzl29m{ScA6$0!{`(6=EH2`d8YC_x4-f%|C`zQ_u2K(%>4EG*LR-g zz3?rhIr9-Pjv$FDnNjFClS`b