class GameScene
Constants
- BLOCK_SIZE
- HEIGHT
- WIDTH
Public Class Methods
new(window, difficulty)
click to toggle source
Calls superclass method
Scene::new
# File lib/scene.rb, line 111 def initialize(window, difficulty) super(window) @game = Game.new(window,10, 50, HEIGHT, WIDTH, BLOCK_SIZE, difficulty) @ticks = 0 end
Public Instance Methods
draw()
click to toggle source
# File lib/scene.rb, line 143 def draw @window.font.draw_text("Score: #{@game.score}", 10, 10, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW) @window.font.draw_text("Speed: #{@game.current_difficulty}", 250, 10, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW) @game.draw(@window) end
game_running?()
click to toggle source
# File lib/scene.rb, line 139 def game_running? !@game.game_over end
update()
click to toggle source
# File lib/scene.rb, line 117 def update @game.update end