Ejemplo n.º 1
0
        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
            {
            }
        }
Ejemplo n.º 2
0
        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
            {
            }
        }
Ejemplo n.º 3
0
        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 { }
        }
Ejemplo n.º 4
0
        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 { }
        }