require 'gosu'
require_relative 'player'
class SectorFive < Gosu::Window
def initialize
super(800, 600)
self.caption = 'Sector Five'
@player = Player.new(self)
end
end
def draw
@player.draw
end
window = SectorFive.new
window.show
class Player
def initialize(window)
@x = 200
@y = 200
@angle = 0
@image = Gosu::Image.new('images/ship.png')
end
def draw
@image.draw_rot(@x, @y, 1, @angle)
end
end
def draw
needs to be inside the body of class SectorFive
to override the empty method "draw" in the Gosu::Window
base class:class SectorFive < Gosu::Window
..
def draw
..
end
end
draw
, which is never called by anybody.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill