Exemplo n.º 1
0
        public void Update()
        {
            if (Input.GetButtonDown("Pause"))
            {
                Game.GameController.PauseButton();
            }

            if (Game.GameController.IsPaused())
            {
                return;
            }

            Movement();
            if (!hasLiftedBomb)
            {
                FireButton();
                DoPunch();
            }
            else
            {
                if (Input.GetButtonUp(Fire1Button))
                {
                    hasLiftedBomb = false;
                    liftedBomb.transform.parent = null;
                    var pos = liftedBomb.transform.position;
                    liftedBomb.transform.position = Global.GetCoordinatesPosition(Global.GetObjectCoordinates(liftedBomb.gameObject), pos.y);
                    liftedBomb.Throw(playerDir, 3);
                }
            }
        }
Exemplo n.º 2
0
        public static void Punch(GameObject gObj, Direction direction)
        {
            Vector2Int?frontCoord = GetFrontCoordinate(Global.GetObjectCoordinates(gObj), direction);

            if (frontCoord == null)
            {
                return;
            }
            else
            {
                Floor.Coordinates coordinates = Floor.GetCoordinates(frontCoord.Value).Value;
                Debug.Log(coordinates.contentEntity);
                if (coordinates.contentEntity == Entity.BOMB)
                {
                    Bomb.BombController bomb = coordinates.content.GetComponent <Bomb.BombController>();
                    if (bomb.gameObject.layer == 10 ||
                        bomb.gameObject.layer == 11)
                    {
                        bomb.Throw(direction, 3);
                    }
                    else
                    {
                        Debug.Log("KICKED NEW BOMB");
                    }
                }
            }
        }