Added spawner and waypoint components, added building_set_waypoint order, particle emitters can now toggle their emission, buildings can now build and spawn units, buildings now dynamically emit smoke when working and no longer when building, added player2 to default game for testing.

This commit is contained in:
2021-01-01 10:18:16 -06:00
parent 0b3897451e
commit 74458dbfd0
22 changed files with 200 additions and 36 deletions

View File

@@ -0,0 +1,27 @@
class IMICRTS
class Waypoint < Component
def setup
@waypoint = @parent.position.clone
@waypoint.y += @parent.director.map.tile_size
end
def set(vector)
@waypoint = vector
end
def waypoint
@waypoint.clone
end
def draw
return unless @parent.player.selected_entities.include?(@parent)
Gosu.draw_line(
@parent.position.x, @parent.position.y, @parent.player.color,
@waypoint.x, @waypoint.y, @parent.player.color, ZOrder::ENTITY_GIZMOS
)
Gosu.draw_circle(@waypoint.x, @waypoint.y, 4, 9, @parent.player.color, ZOrder::ENTITY_GIZMOS)
end
end
end