mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Seperated entities by building/unit
This commit is contained in:
15
lib/entities/buildings/power_plant.rb
Normal file
15
lib/entities/buildings/power_plant.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
IMICRTS::Entity.define_entity(:power_plant, :building, 800, "Generates power") do |entity|
|
||||
entity.radius = 14
|
||||
entity.max_health = 100.0
|
||||
|
||||
entity.body_image = "vehicles/power_plant/images/power_plant.png"
|
||||
entity.shell_image = "vehicles/power_plant/images/power_plant.png"
|
||||
|
||||
entity.on_tick do
|
||||
entity.produce_power
|
||||
end
|
||||
|
||||
define_singleton_method(:produce_power) do
|
||||
@player.power += 10
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user