nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add some runtime error in nitin.input
[nit.git]
/
examples
/
mnit_dino
/
src
/
dino_android.nit
diff --git
a/examples/mnit_dino/src/dino_android.nit
b/examples/mnit_dino/src/dino_android.nit
index
1284c58
..
ebf1eaf
100644
(file)
--- 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 ).
#
# This file is part of NIT ( http://www.nitlanguage.org ).
#
-# Copyright 2012-2013 Alexis Laferrière <alexis.laf@xymus.net>
+# Copyright 2012-2014 Alexis Laferrière <alexis.laf@xymus.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@
-15,12
+15,14
@@
# limitations under the License.
module dino_android is
# limitations under the License.
module dino_android is
- java_package("org.nitlanguage.dino")
+ app_namespace "org.nitlanguage.dino"
end
import dino
end
import dino
-import mnit_android
+import mnit::android
+import android::portrait
+import android::vibration
redef class ImageSet
redef fun start_over_path do return "images/play_again_mobile.png"
redef class ImageSet
redef fun start_over_path do return "images/play_again_mobile.png"
@@
-34,4
+36,20
@@
redef class Display
redef fun top_offset do return 92
end
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