Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- namespace PacmanPrototype
- {
- public class Game1 : Game
- {
- GraphicsDeviceManager graphics;
- SpriteBatch spriteBatch;
- Map map;
- Texture2D wand;
- Texture2D boden;
- public Game1()
- {
- graphics = new GraphicsDeviceManager(this);
- Content.RootDirectory = "Content";
- }
- protected override void Initialize()
- {
- // TODO: Add your initialization logic here
- base.Initialize();
- }
- protected override void LoadContent()
- {
- // Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = new SpriteBatch(GraphicsDevice);
- // TODO: use this.Content to load your game content here
- wand = Content.Load<Texture2D>("wand");
- boden = Content.Load<Texture2D>("boden");
- map = new Map(wand, boden);
- graphics.PreferredBackBufferWidth = map.map.GetLength(1) * wand.Width;
- graphics.PreferredBackBufferHeight = map.map.GetLength(0) * wand.Height;
- graphics.ApplyChanges();
- }
- protected override void UnloadContent()
- {
- // TODO: Unload any non ContentManager content here
- }
- /// <param name="gameTime">Provides a snapshot of timing values.</param>
- protected override void Update(GameTime gameTime)
- {
- if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
- Exit();
- // TODO: Add your update logic here
- base.Update(gameTime);
- }
- /// <param name="gameTime">Provides a snapshot of timing values.</param>
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.CornflowerBlue);
- // TODO: Add your drawing code here
- map.Draw(spriteBatch);
- base.Draw(gameTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement