Android Open Source - FooTD Grid Object






From Project

Back to project page FooTD.

License

The source code is released under:

GNU General Public License

If you think the Android project FooTD 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.android.footd;
/*  ww w  . ja v a  2s  .  c  om*/
import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

import android.graphics.Point;

public class GridObject extends AnimatedSprite {

  Point gridCoord;
  public GridObject(float pX, float pY, TiledTextureRegion pTiledTextureRegion) {
    super(pX, pY, pTiledTextureRegion);
  }
  
  public GridObject(Point gridCoord, TiledTextureRegion pTiledTextureRegion) {
    super(convertGridPointToFloatPoint(gridCoord).x, convertGridPointToFloatPoint(gridCoord).y, pTiledTextureRegion);
    this.gridCoord = gridCoord;
  }

  public static FloatPoint convertGridPointToFloatPoint(Point gridCoord){
    FloatPoint floatPoint = new FloatPoint(
        Level.GRID_X + Level.CELL_SIZE * gridCoord.x,
        Level.GRID_Y + Level.CELL_SIZE * gridCoord.y
        );
    return floatPoint;
  }
}




Java Source Code List

org.android.footd.DamageType.java
org.android.footd.Difficulty.java
org.android.footd.FloatPoint.java
org.android.footd.GameLogic.java
org.android.footd.GridObject.java
org.android.footd.Level.java
org.android.footd.MobType.java
org.android.footd.Mob.java
org.android.footd.Player.java
org.android.footd.TowerType.java
org.android.footd.Tower.java
org.android.footd.Wave.java