Merge: Kill `model_utils`
[nit.git] / examples / mnit_simple / src / simple.nit
index 42b02ee..b89f8af 100644 (file)
 # limitations under the License.
 
 # Very simple application
-module simple
+module simple is
+       app_name("mnit Simple example") # On Android, this name is hidden by the value in `res/values/strings.xml`
+       app_version(0, 2, git_revision)
+end
 
 import mnit
 
-class MyApp
-       super App
+redef class App
 
        var img : nullable I = null
 
-       init do super
-
-       redef fun init_window
+       redef fun on_create
        do
                super
 
@@ -39,9 +39,9 @@ class MyApp
                img = load_image( "fighter.png" )
        end
 
-       var r: Float = 0.0
-       var g: Float = 0.0
-       var b: Float = 0.0
+       var r = 0.0 is writable
+       var g = 0.0 is writable
+       var b = 0.0 is writable
        redef fun frame_core( display )
        do
                b = b + 0.01
@@ -70,7 +70,3 @@ class MyApp
                end
        end
 end
-
-var app = new MyApp
-app.main_loop
-