samples/test/actual_scene.rb in ray-0.1.0.pre1 vs samples/test/actual_scene.rb in ray-0.1.0
- old
+ new
@@ -5,31 +5,31 @@
class AwesomeScene < Ray::Scene
scene_name :awesome_scene
def setup
- @cursor = Ray::Shape.rectangle [-10, -10, 20, 20], Ray::Color.red
+ @cursor = Ray::Polygon.rectangle [-10, -10, 20, 20], Ray::Color.red
end
def register
on :mouse_motion do |pos|
@cursor.pos = pos
end
end
def render(win)
- @cursor.draw_on win
+ win.draw @cursor
end
attr_reader :cursor
end
class AwesomeGame < Ray::Game
def initialize
super "Hello world!", :size => [600, 600]
AwesomeScene.bind(self)
- push_scene :awesome_scene
+ scenes << :awesome_scene
end
def register
add_hook :quit, method(:exit!)
end