Exemplo n.º 1
0
 void MeterDatos()
 {
     for (int i = 0; i < foo.people.cont; i++)
     {
         Bomberman temp = foo.people.getData(i);
         PeopleEnemy.getData(i).pID         = temp.pID;
         PeopleEnemy.getData(i).hide        = temp.getHide();
         PeopleEnemy.getData(i).putBomb     = temp.getPutBomb();
         PeopleEnemy.getData(i).findEnemy   = temp.getFindEnemy();
         PeopleEnemy.getData(i).findPowerUp = temp.getFindPowerUp();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Metodo que agrega un bomberman a la lista
        /// </summary>
        /// <param name="jugador">Un bomberman</param>
        public void addData(Bomberman jugador)
        {
            Nodo temp = new Nodo();

            temp.data = jugador;
            if (first == null)
            {
                first = temp;
                last  = temp;
            }
            else
            {
                last.Next = temp;
                last      = temp;
            }
            cont++;
        }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     bomberman = FindObjectOfType <Bomberman>();
     if (bomberman.CheakDetonator())
     {
         CanTick = true;
     }
     else
     {
         CanTick = false;
     }
     Counter          = Delay;
     CellsToBlowRight = new List <Vector2>();
     CellsToBlowLeft  = new List <Vector2>();
     CellsToBlowUp    = new List <Vector2>();
     CellsToBlowDown  = new List <Vector2>();
 }
Exemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        Counter      = Delay;
        Bomber       = FindObjectOfType <Bomberman>();
        A_Player     = FindObjectOfType <AudioPlayer>();
        AutoDetonate = Bomber.CheckDetonator();
        CellsToBlowR = new List <Vector2>();
        CellsToBlowL = new List <Vector2>();
        CellsToBlowU = new List <Vector2>();
        CellsToBlowD = new List <Vector2>();
        if (Bomber.CheckDetonator())
        {
            Animate = false;
        }
        else
        {
            Animate = true;
        }
        var animator = GetComponent <Animator>();

        animator.SetBool("Animate", Animate);
    }
Exemplo n.º 5
0
        public override void HandleInput(InputHelper inputHelper)
        {
            if (moving)
            {
                switch (direction)//moves the player
                {
                case 0:
                    position.X += speed;
                    break;

                case 1:
                    position.X -= speed;
                    break;

                case 2:
                    position.Y += speed;
                    break;

                case 3:
                    position.Y -= speed;
                    break;

                default:
                    break;
                }
            }

            if (inputHelper.IsKeyDown(right) && canMove[2])//checks if there isn't a wall next to it and moves the player.
            {
                inputTimer++;
                if (inputTimer == 1)
                {
                    if (!moving)
                    {
                        lastPosition = position;
                        direction    = 0;
                    }
                    moving = true;
                }
            }
            else if (inputHelper.IsKeyDown(left) && canMove[0])
            {//checks if there isn't a wall next to it and moves the player.
                inputTimer++;
                if (inputTimer == 1)
                {
                    if (!moving)
                    {
                        lastPosition = position;
                        direction    = 1;
                    }
                    moving = true;
                }
            }
            else if (inputHelper.IsKeyDown(down) && canMove[3])//checks if there isn't a wall next to it and moves the player.
            {
                inputTimer++;
                if (inputTimer == 1)
                {
                    if (!moving)
                    {
                        lastPosition = position;
                        direction    = 2;
                    }
                    moving = true;
                }
            }
            else if (inputHelper.IsKeyDown(up) && canMove[1])//checks if there isn't a wall next to it and moves the player.
            {
                inputTimer++;
                if (inputTimer == 1)
                {
                    if (!moving)
                    {
                        lastPosition = position;
                        direction    = 3;
                    }
                    moving = true;
                }
            }
            else
            {
                inputTimer = 0;
            }

            if (Bomberman.Distance(position, lastPosition) >= Bomberman.Screen.X / rows)  //stops the player when it reached the next tile
            {
                moving     = false;
                inputTimer = 0;
            }

            //stops the player moving out of bounds
            if (position.X < Bomberman.Screen.X / rows && !moving)
            {
                position.X = 0;
                moving     = false;
            }
            if (position.Y < Bomberman.Screen.Y / columns && !moving)
            {
                position.Y = 0;
                moving     = false;
            }
            if (position.X < 0)
            {
                position.X = 0f;
                moving     = false;
            }
            if (position.X > Bomberman.Screen.X - Bomberman.Screen.X / rows)
            {
                position.X = Bomberman.Screen.X - Bomberman.Screen.X / rows;
                moving     = false;
            }
            if (position.Y < 0)
            {
                moving     = false;
                position.Y = 0;
            }
            if (position.Y > Bomberman.Screen.Y - Bomberman.Screen.Y / columns)
            {
                position.Y = Bomberman.Screen.Y - Bomberman.Screen.Y / columns;
                moving     = false;
            }

            for (int i = 0; i < canMove.Length; i++)//resets the ability for the player to move, this will be determined again the next round
            {
                canMove[i] = true;
            }
        }
Exemplo n.º 6
0
        }/// <summary>

        /// Constructor de la clase nodo
        /// </summary>
        /// <param name="jugador">Un bomberman</param>
        public Nodo(Bomberman jugador)
        {
            data = jugador;
            Next = null;
        }
Exemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     player = GetComponent <Bomberman>();
 }