Class: Swarm::One
- Defined in:
- lib/swarm/levels/one.rb,
lib/swarm/levels/example.rb
Instance Method Summary collapse
Methods inherited from Level
each, #find_player, #initialize, #move, #move_player, #over?, #spawn_player, #update, #update!
Constructor Details
This class inherits a constructor from Swarm::Level
Instance Method Details
#play ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/swarm/levels/one.rb', line 4 def play Catalog.select(:worker).each do |tile| move tile, @player end true end |
#setup ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/swarm/levels/one.rb', line 25 def setup @map.each &:empty! @map.spawn :dirt!, 30 @map.spawn :rock!, 5 @map.spawn :worker!, 0.75 @map.center.player! end |