lib & examples: update modules using the java_package annotation
[nit.git] / examples / mnit_dino / src / dino_android.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2012-2014 Alexis Laferrière <alexis.laf@xymus.net>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 module dino_android is
18 app_namespace "org.nitlanguage.dino"
19 end
20
21 import dino
22
23 import mnit_android
24 import android::portrait
25 import android::vibration
26
27 redef class ImageSet
28 redef fun start_over_path do return "images/play_again_mobile.png"
29 end
30
31 redef class SplashScreen
32 redef fun splash_play_path do return "images/splash_play_mobile.png"
33 end
34
35 redef class Display
36 redef fun top_offset do return 92
37 end
38
39 redef class Dino
40 # When hit, vibrate
41 redef fun hit(hitter, dmg)
42 do
43 app.vibrator.vibrate 25
44 super
45 end
46 end
47
48 redef class Caveman
49 # When crushed, vibrate a little
50 redef fun die(turn)
51 do
52 app.vibrator.vibrate 10
53 super
54 end
55 end