示例#1
0
        public void HandleInput(InputHelper inputHelper)
        {
            //prevents the player from moving when the newlevelbox is visible.
            if (!newLevelBox.Visible)
            {
                level.HandleInput(inputHelper);
            }
            else if (inputHelper.MouseLeftButtonPressed() && !newLevelBox.AbsoluteRectangle.Contains(inputHelper.MousePosition))
            {
                newLevelBox.Visible = false;
            }


            overlay.HandleInput(inputHelper);

            //When space is pressed, we set a tile
            if (inputHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Space))
            {
                if (tileTypeList[selectedTileIndex] == TileType.Start)
                {
                    if (level.Tiles.UpdateStart())
                    {
                        return;
                    }
                }
                Point playerLocation = level.Player.Location;
                Tile  CurrentTile    = Tile.CreateTileFromTileType(tileTypeList[selectedTileIndex]);
                level.Tiles.Add(CurrentTile, playerLocation.X, playerLocation.Y);
                //We need to update the tile graphics, otherwise we might see wrongly displayed tiles (such as not connected wall tiles)
                level.Tiles.UpdateGraphicsToMatchSurroundings(playerLocation);
                CurrentTileChanged(level.Tiles.GetTile(playerLocation));
            }
        }
示例#2
0
 public void HandleInput(InputHelper inputHelper)
 {
     level.HandleInput(inputHelper);
     overlay.HandleInput(inputHelper);
     level.Tiles.UpdateGraphics();
 }
示例#3
0
 public void HandleInput(InputHelper inputHelper)
 {
     MenuContainer.HandleInput(inputHelper);
 }
示例#4
0
 public void HandleInput(InputHelper inputHelper)
 {
     overlay.HandleInput(inputHelper);
 }