Android Open Source - Android-Tile-Based-Game Player Unit






From Project

Back to project page Android-Tile-Based-Game.

License

The source code is released under:

MIT License

If you think the Android project Android-Tile-Based-Game 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 org.ruscoe.example.tilegame;
/*from   ww w.  jav a  2s.  c o m*/
import android.content.Context;

/**
 * An extension of GameUnit, PlayerUnit represents the player-controlled
 * unit in the game.
 * 
 * @author Dan Ruscoe (ruscoe.org)
 * @version 1.0
 */
public class PlayerUnit extends GameUnit
{
  public static final int SPEED = 3;
  
  Context mContext;
  
  private int mUnmodifiedX = 0;
  private int mUnmodifiedY = 0;
  
  public PlayerUnit(Context context, int drawable)
  {
    super(context, drawable);
    this.mContext = context;
  }

  public int getUnmodifiedX()
  {
    return this.mUnmodifiedX;
  }

  public void setUnmodifiedX(int unmodifiedX)
  {
    this.mUnmodifiedX = unmodifiedX;
  }

  public int getUnmodifiedY()
  {
    return this.mUnmodifiedY;
  }

  public void setUnmodifiedY(int unmodifiedY)
  {
    this.mUnmodifiedY = unmodifiedY;
  }
}




Java Source Code List

org.ruscoe.example.tilegame.About.java
org.ruscoe.example.tilegame.GameImage.java
org.ruscoe.example.tilegame.GameTile.java
org.ruscoe.example.tilegame.GameUi.java
org.ruscoe.example.tilegame.GameUnit.java
org.ruscoe.example.tilegame.GameView.java
org.ruscoe.example.tilegame.Play.java
org.ruscoe.example.tilegame.PlayerUnit.java
org.ruscoe.example.tilegame.data.GameDAO.java
org.ruscoe.example.tilegame.data.GameLevelTileData.java
org.ruscoe.example.tilegame.data.GameTileData.java