Module: Cursor

Defined in:
lib/fantasy/cursor.rb

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/fantasy/cursor.rb', line 16

def self.down
  Gosu::KB_DOWN
end

.down?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/fantasy/cursor.rb', line 36

def self.down?
  Gosu.button_down?(Cursor.down)
end

.leftObject



4
5
6
# File 'lib/fantasy/cursor.rb', line 4

def self.left
  Gosu::KB_LEFT
end

.left?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/fantasy/cursor.rb', line 24

def self.left?
  Gosu.button_down?(Cursor.left)
end

.rightObject



8
9
10
# File 'lib/fantasy/cursor.rb', line 8

def self.right
  Gosu::KB_RIGHT
end

.right?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/fantasy/cursor.rb', line 28

def self.right?
  Gosu.button_down?(Cursor.right)
end

.space_barObject



20
21
22
# File 'lib/fantasy/cursor.rb', line 20

def self.space_bar
  Gosu::KB_SPACE
end

.space_bar?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/fantasy/cursor.rb', line 40

def self.space_bar?
  Gosu.button_down?(Cursor.space_bar)
end

.upObject



12
13
14
# File 'lib/fantasy/cursor.rb', line 12

def self.up
  Gosu::KB_UP
end

.up?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fantasy/cursor.rb', line 32

def self.up?
  Gosu.button_down?(Cursor.up)
end