public override void Update() { if (forwardBulletAnim.isIgnoreFrame(0) || backBulletAnim.isIgnoreFrame(0)) { setPosX(getPosX() + getSpeedX()); } ParticularObject Object = getGameWorld().particularObjectManager.getCollisionWidthEnemyObject(this); base.Update(); }
public void RemoveObject(ParticularObject particularObject) { for (int id = 0; id < particularObjects.Count; id++) { ParticularObject Object = particularObjects[id]; if (Object == particularObject) { particularObjects.RemoveAt(id); } } }
public override void UpdateObjects() { base.UpdateObjects(); for (int id = 0; id < particularObjects.Count; id++) { ParticularObject Object = particularObjects[id]; if (Object.isObjectOutOfCameraView() || Object.getState() == ParticularObject.DEATH) { particularObjects.RemoveAt(id); } } }
public override void Update() { base.Update(); setPosX(getPosX() + getSpeedX()); setPosY(getPosY() + getSpeedY()); ParticularObject Object = getGameWorld().particularObjectManager.getCollisionWidthEnemyObject(this); if (Object != null && Object.getState() == ALIVE) { setBlood(0); Object.beHurt(getDamage()); } }
public ParticularObject getCollisionWidthEnemyObject(ParticularObject Object) { for (int id = 0; id < particularObjects.Count; id++) { ParticularObject objectInList = particularObjects[id]; if (Object.getTeamType() != objectInList.getTeamType() && Object.getBoundForCollisionWithEnemy().IntersectsWith(objectInList.getBoundForCollisionWithEnemy())) { return(objectInList); } } return(null); }
public virtual void UpdateObjects() { for (int id = 0; id < particularObjects.Count; id++) { ParticularObject Object = particularObjects[id]; if (!Object.isObjectOutOfCameraView()) { Object.Update(); } if (Object.getState() == ParticularObject.DEATH) { particularObjects.RemoveAt(id); } } }
public void Update() { switch (state) { case INIT_GAME: break; case TUTORIAL: TutorialUpdate(); break; case GAMEPLAY: particularObjectManager.UpdateObjects(); bulletManager.UpdateObjects(); physicalMap.Update(); camera.Update(); if (megaman.getPosX() > finalBossX && finalbossTrigger) { finalbossTrigger = false; switchState(TUTORIAL); tutorialState = MEETFINALBOSS; storyTutorial = 0; openIntroGameY = 550; boss = new FinalBoss(finalBossX + 700, 460, this); boss.setTeamType(ParticularObject.ENEMY_TEAM); boss.setDirection(ParticularObject.LEFT_DIR); particularObjectManager.addObject(boss); } if (megaman.getState() == ParticularObject.DEATH) { numberOfLife--; if (numberOfLife >= 0) { megaman.setBlood(100); megaman.setPosY(megaman.getPosY() - 50); megaman.setState(ParticularObject.NOBEHURT); particularObjectManager.addObject(megaman); } else { switchState(GAMEOVER); bgMusic.controls.stop(); } } if (!finalbossTrigger && boss.getState() == ParticularObject.DEATH) { switchState(GAMEWIN); } break; case GAMEOVER: break; case GAMEWIN: break; } }
public override void Update() { switch (state) { case ALIVE: ParticularObject Object = getGameWorld().particularObjectManager.getCollisionWidthEnemyObject(this); if (Object != null) { if (Object.getDamage() > 0) { beHurt(Object.getDamage()); } } break; case BEHURT: if (behurtBackAnim == null) { state = NOBEHURT; startTimeNoBeHurt = nanoTime(); if (getBlood() == 0) { state = FEY; } } else { behurtForwardAnim.Update(nanoTime()); if (behurtForwardAnim.isLastFrame()) { behurtForwardAnim.reset(); state = NOBEHURT; if (getBlood() == 0) { state = FEY; } startTimeNoBeHurt = nanoTime(); } } break; case FEY: state = DEATH; break; case DEATH: break; case NOBEHURT: if (nanoTime() - startTimeNoBeHurt > timeForNoBeHurt) { state = ALIVE; } break; } }
public void addObject(ParticularObject particularObject) { particularObjects.Add(particularObject); }