Android Open Source - Castle-Invaders Croco






From Project

Back to project page Castle-Invaders.

License

The source code is released under:

GNU General Public License

If you think the Android project Castle-Invaders 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

/**
 * /*w  ww. j  av a 2 s. c  om*/
 */
package com.noobygames.castleinvaders.mobs;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.noobygames.castleinvaders.Assets;
import com.noobygames.castleinvaders.GameLiving;
import com.noobygames.castleinvaders.World.Species;
import com.noobygames.castleinvaders.World.States;

/**
 * @author Tobi
 * 
 */
public class Croco extends GameLiving {

  private static final float CROCO_WIDTH = 120;
  private static final float CROCO_HEIGHT = 120;
  private static final float CROCO_MOVE_VELOCITY = -25;
  public float lifeTime;

  public Croco(float x, float y,
      Species species, int mobLevel, int lane) {
    super(x, y, CROCO_WIDTH, CROCO_HEIGHT, species, lane);
    velocity.set(CROCO_MOVE_VELOCITY, 0);
    position.set(x, y);
    setCenterX(position.x + width / 2);
    lifeTime = 0;

    hp = 100 + mobLevel * 10;
    isCaster = false;
    isRange = false;;
    attackRange = 35; // Der wird am Ende denke mal in Pixeln gez?hlt
              // werden
    attackSpeed = 1.2f; // 0.4f = Soll 0.4x/sec zuhaun
    maxLivingTime = 75; // Soll : In Sekunden
    this.species = com.noobygames.castleinvaders.World.Species.croco;
    attackDamage = 30 + mobLevel;
    this.mobLevel = mobLevel;
    damageType = DamageType.slash;
    fireResi = 0.25f;
    iceResi = 0.25f;
    darknessResi = 0.25f;
    slashResi = 0.35f;
    thrustResi = 0.35f;
    crushResi = 0.35f;
    state = States.walk;
    bowEquipped = false;
  }

  @Override
  public  TextureRegion getAnimation(){
    switch (state) {
    case attack:
      return Assets.crocoAttack.getKeyFrame(stateTime, true);
    case walk:
      return Assets.crocoWalk.getKeyFrame(stateTime, true);
    case run:
      return Assets.crocoRun.getKeyFrame(stateTime, true);
    case hit:
      return Assets.crocoHit.getKeyFrame(stateTime, true);
    case die:
      return Assets.crocoDie.getKeyFrame(stateTime, false);
    case look:
      return Assets.crocoLook.getKeyFrame(stateTime, true);
    }
    return null;
  }

  @Override
  public float getStandartMoveVelocity() {
    
    return Croco.CROCO_MOVE_VELOCITY;
  }
}




Java Source Code List

com.noobgygames.castleinvaders.ui.DragonUltiButton.java
com.noobgygames.castleinvaders.ui.ElementSwitcherButton.java
com.noobgygames.castleinvaders.ui.StoreElement.java
com.noobgygames.castleinvaders.ui.TextureElement.java
com.noobygames.castleinvaders.Assets.java
com.noobygames.castleinvaders.CastleInvaders.java
com.noobygames.castleinvaders.DynamicGameObject.java
com.noobygames.castleinvaders.GameLiving.java
com.noobygames.castleinvaders.GameObject.java
com.noobygames.castleinvaders.MainActivity.java
com.noobygames.castleinvaders.Main.java
com.noobygames.castleinvaders.Player.java
com.noobygames.castleinvaders.Projectile.java
com.noobygames.castleinvaders.Settings.java
com.noobygames.castleinvaders.WorldRenderer.java
com.noobygames.castleinvaders.World.java
com.noobygames.castleinvaders.mobs.Croco.java
com.noobygames.castleinvaders.mobs.EarthDragon.java
com.noobygames.castleinvaders.mobs.FireDragon.java
com.noobygames.castleinvaders.mobs.FireTroll.java
com.noobygames.castleinvaders.mobs.GameScreen.java
com.noobygames.castleinvaders.mobs.GreyTroll.java
com.noobygames.castleinvaders.mobs.IceDragon.java
com.noobygames.castleinvaders.mobs.IceTroll.java
com.noobygames.castleinvaders.mobs.Murloc.java
com.noobygames.castleinvaders.mobs.Orc.java
com.noobygames.castleinvaders.mobs.Skeleton.java
com.noobygames.castleinvaders.screens.GameScreen.java
com.noobygames.castleinvaders.screens.MainMenuScreen.java
com.noobygames.castleinvaders.screens.ScoreScreen.java
com.noobygames.castleinvaders.screens.SplashScreen.java
com.noobygames.castleinvaders.screens.StoreScreen.java
com.noobygames.castleinvaders.store.StoreObject.java
com.noobygames.castleinvaders.store.Store.java
com.noobygames.nerzal.castleinvaders.spells.Burning.java
com.noobygames.nerzal.castleinvaders.spells.Freeze.java
com.noobygames.nerzal.castleinvaders.spells.SpellEffect.java
com.noobygames.nerzal.castleinvaders.spells.Spells.java
com.noobygames.utils.ArrayListUtils.java
com.noobygames.utils.ObjectSelectionContainer.java
com.noobygames.utils.OverlapTester.java
com.noobygames.utils.exceptions.OutOfBoundingException.java
com.noobygames.utils.exceptions.SliderOutOfBoundingsException.java
com.noobygames.utils.ui.Button.java
com.noobygames.utils.ui.ClickableElement.java
com.noobygames.utils.ui.DropDownMenu.java
com.noobygames.utils.ui.Element.java
com.noobygames.utils.ui.RadioButton.java
com.noobygames.utils.ui.RadioGroupButton.java
com.noobygames.utils.ui.ScrollableElement.java
com.noobygames.utils.ui.SimpleElement.java
com.noobygames.utils.ui.Slider.java
com.noobygames.utils.ui.Table.java
com.noobygames.utils.ui.TextBox.java
com.noobygames.utils.ui.Text.java
com.noobygames.utils.ui.Window.java