This commit is contained in:
Robin Hübner 2017-08-09 22:54:24 +02:00
parent 3524712b6f
commit b76bcd53e2
5 changed files with 15 additions and 5 deletions

View File

@ -13,7 +13,7 @@ func fire(delta, vel, dir, speed):
sprite.rotate(dir.angle())
func type():
return "Enemy"
return "Bullet"
func _fixed_process(delta):

View File

@ -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

View File

@ -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()

BIN
raw/minimap.ase (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 832 B