mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Centered helipad building, added barracks and helipad.
This commit is contained in:
9
lib/entities/buildings/barracks.rb
Normal file
9
lib/entities/buildings/barracks.rb
Normal 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
|
||||
10
lib/entities/buildings/helipad.rb
Normal file
10
lib/entities/buildings/helipad.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user