public override void VisitBomb(Bomb b, Vector2 _point) { }
public void createBomb(PlayerID _id) { if (BombManager.Instance().bombAvailable(PlayerID.one)) { Player player = PlayerManager.Instance().getPlayer(_id); player.removeBombSprite(); Ship pShip = player.playerShip; Body pShipBody = pShip.physicsObj.body; Bomb bomb; if (_id == PlayerID.one) bomb = new Bomb(GameObjType.p1Bomb, _id, pShip); else bomb = new Bomb(GameObjType.p2Bomb, _id, pShip); } }
private void reactionToBomb(Missile m, Bomb b, Vector2 _point) { BombManager.Instance().removeBomb(b, b.spriteRef.pos, b.spriteRef.color); GameObjManager.Instance().remove(batchEnum.missiles, m); PlayerManager.Instance().getPlayer(m.owner).increaseNumMissiles(); }
private void reactionToBomb(Ship s, Bomb b, Vector2 _point) { if (s.type == GameObjType.p1ship) { GameObjManager.Instance().remove(batchEnum.ships, s); BombManager.Instance().removeBomb(b, s.spriteRef.pos, s.spriteRef.color); s.hit(PlayerID.one); ScoreManager.Instance().p2Kill(); playShipHitSound(); } else if (s.type == GameObjType.p2ship) { GameObjManager.Instance().remove(batchEnum.ships, s); BombManager.Instance().removeBomb(b, s.spriteRef.pos, s.spriteRef.color); s.hit(PlayerID.two); ScoreManager.Instance().p1Kill(); playShipHitSound(); } else { } }
public override void VisitBomb(Bomb b, Vector2 _point) { reactionToMissile(this, b, _point); }
public override void VisitBomb(Bomb b, Vector2 _point) { reactionToShip(this, b, _point); }
public virtual void VisitBomb(Bomb b, Vector2 _point) { }
public void removeBomb(Bomb b, Vector2 _pos, Color _color) { if (b.state == BombState.alive) { b.state = BombState.dead; b.spriteRef.sprite.image = b.image1; GameObjManager.Instance().addExplosion(_pos, _color); GameObjManager.Instance().remove(batchEnum.bomb, b); BombManager.Instance().addBomb(b); playBombHitSound(); PlayerManager.Instance().getPlayer(b.owner).addBombSprite(); } }
private void addBomb(Bomb b) { if (b.owner == PlayerID.one) { p1BombTable[b.bombID] = b.bombsprite; p1Ptr--; } else { p2BombTable[b.bombID] = b.bombsprite; p2Ptr--; } }