示例#1
0
        public void DrawCreateData(GameGrid gameGrid, int gridCount, ref GridData gridData, MouseState mouseState, Vector2 mouseInWorld, int position, int size, GridCell selectedCell, KeyboardState keyboardState, KeyboardState previousState1)
        {
            do
            {
                if (mouseState.LeftButton == ButtonState.Pressed & mouseInWorld.Y <position + size& mouseInWorld.Y> position & mouseInWorld.X <position + size& mouseInWorld.X> position)
                {
                    int tempMouseInWorldX = (int)mouseInWorld.X / 100;
                    tempMouseInWorldX *= 100;

                    int tempMouseInWorldY = (int)mouseInWorld.Y / 100;
                    tempMouseInWorldY *= 100;
                    selectedCell       = new GridCell((tempMouseInWorldY - position - (gridData.gridCount / size)) / 100, (tempMouseInWorldX - position - (gridData.gridCount / size)) / 100, gridData.sections[0], gridData);
                }
            } while (keyboardState.IsKeyDown(Keys.Enter) & !previousState1.IsKeyDown(
                         Keys.Enter));
            gameGrid.Draw(gridData);
        }
示例#2
0
 public void DrawGamePlay(GameGrid gameGrid, GridData gridData)
 {
     gameGrid.Draw(gridData);
 }