version 0.7.5
[nit.git] / examples / shoot / src / shoot.nit
index 94f13e9..fd94447 100644 (file)
 
 # Space shooter.
 # This program is a fun game but also a good example of the scene2d module
-module shoot
+module shoot is
+       app_name("Space Shooter")
+       app_version(0, 1, git_revision)
+end
 
 import mnit
 import shoot_logic
@@ -219,7 +222,7 @@ redef class PlayScene
                                end
                        end
                        return true
-               else if input_event isa PointerEvent then
+               else if input_event isa PointerEvent and input_event.pressed then
                        var x = (input_event.x * app.scale).to_i
                        var y = (input_event.y * app.scale).to_i
                        player.goes_to(x, y, speed)
@@ -312,7 +315,7 @@ redef class App
        var img_boss_left: Image
        var img_boss_right: Image
 
-       redef fun window_created
+       redef fun on_create
        do
                super
 
@@ -377,9 +380,6 @@ redef class App
                        if not self.scene.exists then quit = true
                end
                self.scene.draw_on_display(self)
-
-               # Wait the next frame
-               sys.nanosleep(0, 16000000)
        end
 
        var paused: Bool = false