Android Open Source - game-api-android Test Game Roel






From Project

Back to project page game-api-android.

License

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.

Java Source Code

package testGames;
//ww w  .  j a  va2s  . c  o m
import android.gameengine.icadroids.engine.GameEngine;
import android.gameengine.icadroids.input.OnScreenButtons;
import android.gameengine.icadroids.objects.MoveableGameObject;
import android.util.Log;

/**
 * Deze game test het trillen van de telefoon en OnscreenButtons.
 * 
 * @author Roel van Bergen
 * 
 */
public class TestGameRoel extends GameEngine {

  private static final String TAG = "ButtonEnabled";
  private MoveableGameObject player;
  private final long[] pattern = { 200, 500, 200, 800, 200, 500, 200 };

  public TestGameRoel() {
    super();
    player = new MoveableGameObject();
    addGameObject(player, 0, 0);
    setPlayer(player);

  }

  @Override
  protected void initialize() {
    // Must be set before calling start game
    OnScreenButtons.use = true;
    OnScreenButtons.feedback = true;
    OnScreenButtons.opacity = 255;
  }

  @Override
  public void update() {
    if (OnScreenButtons.dPadUp)
      Log.d(TAG, "DPADUP has been pressed");
    if (OnScreenButtons.dPadDown)
      Log.d(TAG, "DPADDOWN has been pressed");
    if (OnScreenButtons.dPadLeft)
      Log.d(TAG, "DPADLEFT has been pressed");
    if (OnScreenButtons.dPadRight)
      Log.d(TAG, "DPADRIGHT has been pressed");
    if (OnScreenButtons.start)
      vibrate(pattern);
    if (OnScreenButtons.select)
      Log.d(TAG, "SELECT has been pressed");
    if (OnScreenButtons.buttonA)
      Log.d(TAG, "BUTTON1 has been pressed");
    if (OnScreenButtons.buttonB)
      Log.d(TAG, "BUTTON2 has been pressed");
  }

}




Java Source Code List

android.gameengine.icadroids.alarms.Alarm.java
android.gameengine.icadroids.alarms.IAlarm.java
android.gameengine.icadroids.dashboard.DashboardImageView.java
android.gameengine.icadroids.dashboard.DashboardTextView.java
android.gameengine.icadroids.engine.GameEngine.java
android.gameengine.icadroids.engine.GameFPSCounter.java
android.gameengine.icadroids.engine.GameThread.java
android.gameengine.icadroids.engine.GameView.java
android.gameengine.icadroids.engine.Viewport.java
android.gameengine.icadroids.forms.GameForm.java
android.gameengine.icadroids.forms.IFormInput.java
android.gameengine.icadroids.forms.ViewCreator.java
android.gameengine.icadroids.forms.ViewRemover.java
android.gameengine.icadroids.input.MotionSensor.java
android.gameengine.icadroids.input.OnScreenButton.java
android.gameengine.icadroids.input.OnScreenButtons.java
android.gameengine.icadroids.input.TouchInput.java
android.gameengine.icadroids.objects.GameObject.java
android.gameengine.icadroids.objects.MoveableGameObject.java
android.gameengine.icadroids.objects.collisions.CollidingObject.java
android.gameengine.icadroids.objects.collisions.ICollision.java
android.gameengine.icadroids.objects.collisions.TileCollision.java
android.gameengine.icadroids.objects.graphics.AnimatedSprite.java
android.gameengine.icadroids.objects.graphics.Sprite.java
android.gameengine.icadroids.persistence.GamePersistence.java
android.gameengine.icadroids.sound.GameSound.java
android.gameengine.icadroids.sound.MusicPlayer.java
android.gameengine.icadroids.tiles.GameTiles.java
android.gameengine.icadroids.tiles.Tile.java
com.android.vissenspel.Monster.java
com.android.vissenspel.StrawberryControler.java
com.android.vissenspel.Strawberry.java
com.android.vissenspel.Vis.java
com.android.vissenspel.Vissenkom.java
game.MyAndroidGame.java
testGames.AndroidCraft_demo.java
testGames.FormTest.java
testGames.Player.java
testGames.TestGameBas.java
testGames.TestGameLex.java
testGames.TestGameRoel.java
testGames.gameEngineTest.DebugEngine.java
testGames.gameEngineTest.GameEngineTestGame.java
testGames.gameEngineTest.TestGameObject.java
testGames.gameEngineTest.debugObject.java
testGames.gameEngineTest.randomObject.java
testGames.testGameObjectBas.java
testGames.testGame.java