Centered helipad building, added barracks and helipad.

This commit is contained in:
2019-11-20 17:45:41 -06:00
parent 8be8fdb225
commit fa0eabd52f
8 changed files with 95 additions and 49 deletions

View File

@@ -0,0 +1,9 @@
IMICRTS::Entity.define_entity(:barracks, :building, 400, "Builds and soldiers") do |entity|
entity.radius = 44
entity.max_health = 100.0
entity.shell_image = "buildings/barracks/barracks.png"
entity.on_tick do
end
end

View File

@@ -0,0 +1,10 @@
IMICRTS::Entity.define_entity(:helipad, :building, 1_000, "Builds and rearms helicopters") do |entity|
entity.radius = 26
entity.max_health = 100.0
entity.shell_image = "buildings/helipad/helipad_shell.png"
entity.overlay_image = "buildings/helipad/helipad_overlay.png"
entity.on_tick do
end
end

View File

@@ -46,6 +46,7 @@ class IMICRTS
raise "Failed to find entity #{name.inspect} definition"
end
@boid_radius = @radius + 8
component(:turret).angle = @angle if component(:turret)
@goal_color = Gosu::Color.argb(175, 25, 200, 25)
@@ -149,6 +150,7 @@ class IMICRTS
def draw_radius
Gosu.draw_circle(@position.x, @position.y, @radius, ZOrder::ENTITY_RADIUS, @player.color, 360 / 18)
Gosu.draw_circle(@position.x, @position.y, @boid_radius, ZOrder::ENTITY_RADIUS, @player.color, 360 / 18)
end
def draw_gizmos

View File

@@ -1,6 +1,7 @@
class IMICRTS
class Closing < CyberarmEngine::GuiState
def setup
window.show_cursor = false
@logo = Gosu::Image.new("#{ASSETS_PATH}/logo.png")
@color = Gosu::Color.new(0xffffffff)

View File

@@ -107,6 +107,22 @@ class IMICRTS
position: CyberarmEngine::Vector.new(spawnpoint.x + 130, spawnpoint.y - 64, ZOrder::BUILDING),
angle: 0
)
@player.entities << Entity.new(
name: :helipad,
director: @director,
player: @player,
id: @player.next_entity_id,
position: CyberarmEngine::Vector.new(spawnpoint.x - 32, spawnpoint.y - 96, ZOrder::BUILDING),
angle: 0
)
@player.entities << Entity.new(
name: :barracks,
director: @director,
player: @player,
id: @player.next_entity_id,
position: CyberarmEngine::Vector.new(spawnpoint.x - 32, spawnpoint.y + 128, ZOrder::BUILDING),
angle: 0
)
end
def draw