Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class GameState
- {
- public static List<Block> Blocks = new List<Block>();
- public enum GameStateEnum
- {
- Playing,
- GameOver
- }
- public static GameStateEnum CurrentGameState = GameStateEnum.Playing;
- public static void AddBlock()
- {
- Block newBlock = new Block();
- Blocks.Add(newBlock);
- }
- public static void AddBlock(Block.BlockType blockType)
- {
- Block newBlock = new Block(blockType);
- Blocks.Add(newBlock);
- }
- public static void DrawBlocks(GameTime gameTime, SpriteBatch spriteBatch)
- {
- foreach (Block block in Blocks)
- {
- if (block.Visible)
- {
- for (int x = 0; x < block.Size; x++)
- {
- for (int y = 0; y < block.Size; y++)
- {
- if (block.Layout[x, y] == true)
- {
- spriteBatch.Draw(block.Texture, block.Texture.Width * new Vector2(block.X + x, block.Y + y), block.Color);
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment