contrib/asteronits & model_viewer: fix user for new Y direction and rotation
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 1 Feb 2016 19:36:44 +0000 (14:36 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 5 Feb 2016 23:17:03 +0000 (18:17 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/asteronits/src/asteronits.nit
contrib/model_viewer/src/model_viewer.nit

index a2aed95..080957b 100644 (file)
@@ -129,7 +129,7 @@ redef class SpacialObject
        redef fun do_turn(dt)
        do
                super
-               sprite.rotation = rotation + pi/2.0
+               sprite.rotation = rotation - pi/2.0
        end
 
        redef fun destroy
@@ -191,7 +191,7 @@ redef class Ship
                thrust_sprite.center.x = center.x - dist_to_engine*rotation.cos
                thrust_sprite.center.y = center.y - dist_to_engine*rotation.sin
                thrust_sprite.center.z = center.z
-               thrust_sprite.rotation = rotation + pi/2.0
+               thrust_sprite.rotation = rotation - pi/2.0
 
                # Show or hide the thrust sprite
                if applied_thrust > 0.0 then
@@ -231,8 +231,8 @@ redef class KeyEvent
        # How does this event affect the ship thrust?
        fun rotation: Float
        do
-               if is_arrow_right or name == "d" then return 1.0
-               if is_arrow_left or name == "a" then return -1.0
+               if is_arrow_right or name == "d" then return -1.0
+               if is_arrow_left or name == "a" then return 1.0
                return 0.0
        end
 end
index 578f660..ab2e4b3 100644 (file)
@@ -78,12 +78,12 @@ redef class App
                ui_camera.reset_height 800.0
 
                var prev_sprite = new Sprite(ui_prev,
-                       ui_camera.bottom_left.offset(200, -40, 0))
+                       ui_camera.bottom_left.offset(200, 40, 0))
                prev_sprite.scale = 0.5
                ui_sprites.add prev_sprite
 
                var next_sprite = new Sprite(ui_next,
-                       ui_camera.bottom_right.offset(-165, -40, 0))
+                       ui_camera.bottom_right.offset(-165, 40, 0))
                next_sprite.scale = 0.5
                ui_sprites.add next_sprite
        end