コード例 #1
0
 public void dieNow() {
   Gdx.app.debug("BuggySprite", "dieNow called");
   if ((m_dying == false) && (m_alive)) {
     Gdx.app.debug("BuggyrSprite", "dying!!!!");
     this.playSound("vaporize", 0.8f);
     m_inHit = false;
     m_ignoreHits = 0;
     m_explodeDeath = true;
     m_energy = 0;
     this.stopAllAnimations();
     m_invincibleAnimation.stop();
     this.stopSound("buggyDrive");
     PooledEffect effect = m_gameLayer.bombEffectPool.obtain();
     effect.setPosition(this.getX() + this.getWidth() / 2, this.getY());
     m_gameLayer.addParticleEffect(effect);
     this.runAnimation(m_throughDoorAnimation);
     m_dying = true;
     m_deadState = 1;
     if (m_focus == false) {
       m_gameLayer.buggyDieWithoutFocus();
     }
   }
 }
コード例 #2
0
  public void stopHover(boolean forReals) {
    if (m_hover) {
      m_hoverSprite.setVisible(false);
      this.stopAllAnimations();
      m_hover = false;
      m_dx = 0;
      m_dy = 0;
      m_climbing = false;
      m_inSwamp = false;
      maxSpeedX = defaultMaxSpeedX;
      if (forReals) {
        m_gameLayer.setPlayerXOffsetTarget(0);
      }
    }

    if (m_wrappedUp) {
      m_wrappedUp = false;
      this.stopAllAnimations();
    }
  }
コード例 #3
0
  public BuggySprite(
      TextureAtlas myTextures,
      TiledMapTileLayer pTiles,
      TiledMapTileLayer lTiles,
      ArrayList<PlatformSprite> platforms,
      GameInputManager inputManager,
      int lives,
      World world,
      MainGameLayer gameLayer) {

    super(myTextures.findRegion("buggy_F1"), pTiles, lTiles);
    standRegion = myTextures.findRegion("buggy_F1");
    m_walkAnimation =
        new AnimateSpriteFrame(myTextures, new String[] {"buggy_F1", "buggy_F2"}, 0.3f, -1);
    m_standAnimation = new AnimateSpriteFrame(myTextures, new String[] {"buggy_F1"}, 1.0f, -1);

    m_attackAnimation = new AnimateSpriteFrame(myTextures, new String[] {"man_stand_F1"}, 0.3f, 1);

    m_hitAnimation = null;
    m_tutorialAnimation = new AnimateSpriteFrame(myTextures, new String[] {"buggy_F1"}, 0.5f, -1);
    m_idleAnimation = new AnimateSpriteFrame(myTextures, new String[] {"buggy_F1"}, 0.5f, -1);

    m_throughDoorAnimation = new AnimateFadeOut(0.5f);
    m_floatAnimation =
        new AnimateSpriteFrame(myTextures, new String[] {"man_jump_F3", "man_jump_F3"}, 0.65f, -1);

    m_teleportIn = new AnimateFadeIn(0.35f);
    m_teleportOut = new AnimateFadeOut(0.35f);

    AnimateTranslateVertical f1 = new AnimateTranslateVertical(1.0f, 0f, -3f, 1);
    AnimateTranslateVertical f2 = new AnimateTranslateVertical(3.0f, 1.0f, -1f, 1);
    GameAnimateable[] af = {f1, f2};

    m_floatAnimation2 = new GameAnimationSequence(af, -1);

    AnimateFade fo = new AnimateFade(0.2f, 0.9f, 0.2f);
    AnimateDelay delay = new AnimateDelay(0.25f);
    AnimateFade fi = new AnimateFade(0.2f, 0.2f, 0.9f);
    AnimateFade ff = new AnimateFade(0.25f, 0.2f, 1.0f);
    GameAnimateable[] a = {fo, fi, delay, fo, fi, delay, fo, ff};

    m_invincibleAnimation = new GameAnimationSequence(a, 1);
    m_invincibleAnimation.setIgnoreStop(true);

    m_inputManager = inputManager;
    m_platforms = platforms;

    m_activeWeapon = null;

    maxSpeedX = 6.0f;
    defaultMaxSpeedX = 6.0f;
    maxSpeedY = 4.0f;
    maxFallVelocity = 20.0f;
    m_horizontalDragFactor = 1.0f;
    m_climbingDragFactor = 0.25f;
    m_gravity = 0.8f;

    m_jumping = false;
    m_climbing = false;
    m_currDir = 1;

    m_lives = lives;
    m_boundingBox.width = this.getBoundingRectangle().width / 4;
    m_boundOffX = this.getBoundingRectangle().width / 2;
    m_boundingBox.height = this.getBoundingRectangle().height / 5;

    m_gameLayer = gameLayer;

    this.runAnimation(m_standAnimation);

    if (gameLayer.m_stage > 1)
      pLight = gameLayer.createConeLight(new Color(0.8f, 0.8f, 0.5f, 0.75f), 1100, 0, 0, 0, 25);
    else pLight = gameLayer.createConeLight(new Color(0.8f, 0.8f, 0.5f, 0.35f), 700, 0, 0, 0, 25);

    pLight.setXray(true);
    pLight.setActive(false);
    m_lightX = this.getWidth() - 20;
  }