diff options
Diffstat (limited to 'test/src/main.rb')
-rw-r--r-- | test/src/main.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/src/main.rb b/test/src/main.rb index b153a50..f5c0676 100644 --- a/test/src/main.rb +++ b/test/src/main.rb @@ -18,8 +18,10 @@ TRANSLATION_SPEED = 0.5; def init() $texture = CandyGear::Texture.from_image("textures/color_texture.png"); - $sprite = CandyGear::Sprite.new($texture, 0, 0, 1.0, 1.0); $model = CandyGear::Model.new("models/cube.cgmodel", $texture); + $sprite = CandyGear::Sprite.new( + $texture, CandyGear::Vector4D.new(0, 0, 1.0, 1.0)); + $sprite_position = CandyGear::Vector4D.new(1.0, 1.0, 101.0, 101.0); $instances = [ CandyGear::Vector3D.new(5.0, 0.0, 0.0), @@ -33,7 +35,7 @@ def init() $camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); $camera_rotation = CandyGear::Rotation3D.new(0.0, 0.0, 0.0); - CandyGear.camera_position = $camera_position + CandyGear.camera_position = $camera_position; CandyGear.camera_rotation = $camera_rotation; end @@ -68,7 +70,7 @@ end def quit() = CandyGear.quit(); def tick() - $sprite.draw(1.0, 1.0, 101.0, 101.0); + $sprite.draw($sprite_position); $instances_rotation.rotate(0.0, BOX_ROTATION_SPEED); $instances.each do |i| $model.draw(i, $instances_rotation); |