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 { } }
private void reactionToMissile(Missile m, Ship s, Vector2 _point) { if (s.type == GameObjType.p1ship && m.type == GameObjType.p2missiles) { GameObjManager.Instance().addExplosion(s.spriteRef.pos, s.spriteRef.color); GameObjManager.Instance().remove(batchEnum.ships, s); GameObjManager.Instance().remove(batchEnum.missiles, m); s.hit(PlayerID.one); ScoreManager.Instance().p2Kill(); playMissileHitSound(); playShipHitSound(); PlayerManager.Instance().getPlayer(m.owner).increaseNumMissiles(); } else if (s.type == GameObjType.p2ship && m.type == GameObjType.p1missiles) { GameObjManager.Instance().addExplosion(s.spriteRef.pos, s.spriteRef.color); GameObjManager.Instance().remove(batchEnum.ships, s); GameObjManager.Instance().remove(batchEnum.missiles, m); s.hit(PlayerID.two); ScoreManager.Instance().p1Kill(); playMissileHitSound(); playShipHitSound(); PlayerManager.Instance().getPlayer(m.owner).increaseNumMissiles(); } else { } }
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 { } }
private void reactionToMissile(Missile m, Ship s, Vector2 _point) { if (s.type == GameObjType.p1ship && m.type == GameObjType.p2missiles) { GameObjManager.Instance().addExplosion(s.spriteRef.pos, s.spriteRef.color); GameObjManager.Instance().remove(batchEnum.ships, s); GameObjManager.Instance().remove(batchEnum.missiles, m); s.hit(PlayerID.one); ScoreManager.Instance().p2Kill(); playMissileHitSound(); playShipHitSound(); PlayerManager.Instance().getPlayer(m.owner).increaseNumMissiles(); } else if (s.type == GameObjType.p2ship && m.type == GameObjType.p1missiles) { GameObjManager.Instance().addExplosion(s.spriteRef.pos, s.spriteRef.color); GameObjManager.Instance().remove(batchEnum.ships, s); GameObjManager.Instance().remove(batchEnum.missiles, m); s.hit(PlayerID.two); ScoreManager.Instance().p1Kill(); playMissileHitSound(); playShipHitSound(); PlayerManager.Instance().getPlayer(m.owner).increaseNumMissiles(); } else { } }