Class: Swarm::Intro

Inherits:
Level
  • Object
show all
Defined in:
lib/swarm/levels/intro.rb

Instance Method Summary collapse

Methods inherited from Level

each, #find_player, #initialize, #move, #move_player, #spawn_player, #update, #update!

Constructor Details

This class inherits a constructor from Swarm::Level

Instance Method Details

#over?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/swarm/levels/intro.rb', line 31

def over?
  @over
end

#playObject



3
4
5
# File 'lib/swarm/levels/intro.rb', line 3

def play
  @over = true
end

#setupObject



27
28
29
# File 'lib/swarm/levels/intro.rb', line 27

def setup
  @map.center.player!
end

#show(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/swarm/levels/intro.rb', line 7

def show(*args)
  @over = false
  pause do <<-POPUP.gsub(/[ ]{10}/, '') % Console.key_info
                  Swarm Instructions
      ----------------------------------------------
                  Movement:
                    north: %<north>s
                    south: %<south>s
                    west:  %<west>s
                    east:  %<east>s

                  Pause: %<pause>s
                  Quit:  %<quit>s
      ----------------------------------------------

                  Press %<pause>s to begin.
    POPUP
  end
end