Android Open Source - FooTD Mob Type






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;
/* w  w w.  j  a  va 2 s.  c  o m*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

import android.content.Context;
import android.graphics.Point;

public class MobType {
    public enum MobAbility { Normal, Flying, Immune }

    Map<String, Point> ranges = new HashMap<String, Point>();
    DamageType type;
    List<MobAbility> abilities;
    private float scale;
  public TiledTextureRegion texture;
  float speed;

    public MobType(Engine engine, Context context, float scale, Point tiles, String textureName, float speed) {
      this.scale = scale;
      this.speed = speed;
      texture = Level.readSprite(engine, context, tiles, textureName);
    }

    public MobType(Engine engine, Context context, Point tiles, String textureName, float speed) {
      this.scale = 1.0f;
      this.speed = speed;
      texture = Level.readSprite(engine, context, tiles, textureName);
    }
    
    public MobType(Engine engine, Context context, Point tiles, String textureName) {
      this.scale = 1.0f;
      this.speed = 1.0f;
      texture = Level.readSprite(engine, context, tiles, textureName);
    }

    public int getWidth() {
      return (int) (scale * texture.getTileWidth());
    }

    public int getHeight() {
      return (int) (scale * texture.getTileHeight());
    }
}




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