I continue to get the "unexpected end, expecting kEND" error
Could someone please take a look at this
main.rb
player.rb
Could someone please take a look at this
main.rb
Code:
require 'rubygems'
require 'gosu'
require 'player'
class MyGame < Gosu::Window
def initialize
super(300, 400, false)
@player = Player.new(self)
end
def update
if button_down? Gosu::Button::KbLeft
@player.move_left
if button_down? Gosu::Button::KbRight
@player.move_right
end
def draw
@player.draw
end
end
window = MyGame.new
window.show
player.rb
Code:
class Player
def initialize(game_window)
@game_window = game_window
@icon = Gosu::Image.new(@game_window, "images/orgbad.png", true)
@x = 50
@y = 50
end
def draw
@icon.draw(@x, @y, 1)
end
def move_left
@x = @x - 2
end
def move_right
@x = @x + 2
end
end