android: bin/asteronits.apk
bin/asteronits.apk: $(shell ${NITLS} -M src/asteronits.nit android) ${NITC} res/drawable-hdpi/icon.png pre-build
- ${NITC} src/touch_ui.nit -m android -o $@
+ ${NITC} src/android.nit -m android -o $@
android-release: $(shell ${NITLS} -M src/asteronits.nit android) ${NITC} res/drawable-hdpi/icon.png pre-build
- ${NITC} src/touch_ui.nit -m android -o bin/asteronits.apk --release
+ ${NITC} src/android.nit -m android -o bin/asteronits.apk --release
res/drawable-hdpi/icon.png: art/icon.svg
make -C ../inkscape_tools/
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import ::android::platform
+import ::android::vibration
+
+import asteronits
+import touch_ui
+
+redef class Ship
+ redef fun hit
+ do
+ super
+ app.vibrator.vibrate 20
+ end
+end
+
+redef class Asteroid
+ redef fun destroy
+ do
+ super
+ app.vibrator.vibrate 10
+ end
+end