it keeps on saying syntax error unexpected ' n' expecting :: [' or '.' and syntax error unexpected keyword_ensure expecting end-of-input. what is the problem with my code?
require 'rubygems'
require 'rubygame'
class
def initialize
@screen = Rubygame::Screen.new [640, 480], 0, [Rubygame::HWSURFACE, Rubygame::DOUBLEBUF]
@screen.title = "Pong"
@queue = Rubygame::EventQueue.new
@clock = Rubygame::Clock.new
@clock.target_framerate = 60
end
def run!
loop do
update
draw
@clock.tick
end
end
def update
end
def draw
end
end
g = Game.new
g.run!
You don't have a class name, just the keyword 'class'.