Exemplo n.º 1
0
 public Player(int x, int y)
 {
     this.XPosition = x;
     this.YPosition = y;
     this.positionToBeChecked = new Position(x, y);
 }
Exemplo n.º 2
0
        public bool CheckForCollision(Position pos)
        {
            //return true;

            switch (World.WorldMatrix[pos.Y, pos.X])
            {
                case CellState.EmptySpace:
                    return true;
                case CellState.Enemy:
                    OnEnemyEncountered();
                    return true;
                case CellState.Shop:
                    //OnStartShop();
                    return true;
                case CellState.Wall:
                    return false;
                default:
                    return false;
            }

            //if(map[pos.Y, pos.X] == Map.Shop)
            //{
            //      Shop();
            //}

            //To be checked the position on the world map
            //if(map[pos.y, pos.x] == Map.Shop...Map.Enemy...Map.Empty....Map.Wall)
            //if (World.WorldMatrix[pos.Y, pos.X] == CellState.Enemy/*pos.X == 10 && pos.Y == 30*/)
            //{
            //    OnStartBattle();
            //    //BattleScreen.StartBattle();
            //    //XPosition++;
            //}
            //check if its on shop, wall or some other object in the world
        }