class Core::States::State

Skeleton for game states

Provides a cursor

Attributes

window[R]
x[R]
y[R]

Public Class Methods

new(window) click to toggle source
# File lib/states/states.rb, line 13
def initialize(window)
  @window = Core.window = window
  @x = @y = 0
  @cursor = Core::Cursor.new
end

Public Instance Methods

draw() click to toggle source
# File lib/states/states.rb, line 25
def draw
  draw_cursor
end
draw_cursor() click to toggle source
# File lib/states/states.rb, line 28
def draw_cursor
  @cursor.draw
end
finish() click to toggle source
# File lib/states/states.rb, line 31
def finish
end
update() click to toggle source
# File lib/states/states.rb, line 18
def update
  update_cursor
end
update_cursor() click to toggle source
# File lib/states/states.rb, line 21
def update_cursor
  @x, @y = @window.mouse_x, @window.mouse_y
  @cursor.update(@x, @y)
end