X-Git-Url: http://nitlanguage.org diff --git a/examples/mnit_dino/src/dino_android.nit b/examples/mnit_dino/src/dino_android.nit index f2a7260..be92d49 100644 --- a/examples/mnit_dino/src/dino_android.nit +++ b/examples/mnit_dino/src/dino_android.nit @@ -1,6 +1,6 @@ # This file is part of NIT ( http://www.nitlanguage.org ). # -# Copyright 2012-2013 Alexis Laferrière +# Copyright 2012-2014 Alexis Laferrière # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,11 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -module dino_android +module dino_android is + app_namespace "org.nitlanguage.dino" +end import dino import mnit_android +import android::portrait +import android::vibration redef class ImageSet redef fun start_over_path do return "images/play_again_mobile.png" @@ -32,4 +36,20 @@ redef class Display redef fun top_offset do return 92 end -super +redef class Dino + # When hit, vibrate + redef fun hit(hitter, dmg) + do + app.vibrator.vibrate 25 + super + end +end + +redef class Caveman + # When crushed, vibrate a little + redef fun die(turn) + do + app.vibrator.vibrate 10 + super + end +end