Back to project page game-api-android.
The source code is released under:
MIT License
If you think the Android project game-api-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package testGames.gameEngineTest; //from w w w. j ava 2s . co m import android.gameengine.icadroids.alarms.Alarm; import android.gameengine.icadroids.alarms.IAlarm; import android.gameengine.icadroids.objects.MoveableGameObject; /** * Dit GameObject test Animated sprites en Alarms. * * @author Bas van der Zandt * */ public class randomObject extends MoveableGameObject implements IAlarm { Alarm am = new Alarm(1, 300, this); Alarm am2 = new Alarm(2, 60, this); int timesAlarmTriggerd = 0; public randomObject() { setSprite("fishframes", 4); getSprite().nextFrame(); startAnimate(); setAnimationSpeed(10); } public void triggerAlarm(int alarmID) { if (alarmID == 1) { deleteThisGameObject(); } if (alarmID == 2) { timesAlarmTriggerd++; // System.out.println("Times alarm triggerd: " + // timesAlarmTriggerd); am2.restartAlarm(); } } }