2 using System.Collections.Generic;
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Audio;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.GamerServices;
8 using Microsoft.Xna.Framework.Graphics;
9 using Microsoft.Xna.Framework.Input;
10 using Microsoft.Xna.Framework.Media;
11 using Microsoft.Xna.Framework.Net;
12 using Microsoft.Xna.Framework.Storage;
15 namespace CharacterTestBed
18 /// This is the main type for your game
20 public class Game1 : Microsoft.Xna.Framework.Game
22 GraphicsDeviceManager graphics;
23 SpriteBatch spriteBatch;
27 graphics = new GraphicsDeviceManager(this);
28 Content.RootDirectory = "Content";
32 /// Allows the game to perform any initialization it needs to before starting to run.
33 /// This is where it can query for any required services and load any non-graphic
34 /// related content. Calling base.Initialize will enumerate through any components
35 /// and initialize them as well.
37 protected override void Initialize()
39 // TODO: Add your initialization logic here
45 /// LoadContent will be called once per game and is the place to load
46 /// all of your content.
48 protected override void LoadContent()
50 // Create a new SpriteBatch, which can be used to draw textures.
51 spriteBatch = new SpriteBatch(GraphicsDevice);
53 p = new Player(new Map(), Content.Load<Texture2D>("pinball"), 4, 100, 20, 10);
54 // TODO: use this.Content to load your game content here
58 /// UnloadContent will be called once per game and is the place to unload
61 protected override void UnloadContent()
63 // TODO: Unload any non ContentManager content here
67 /// Allows the game to run logic such as updating the world,
68 /// checking for collisions, gathering input, and playing audio.
70 /// <param name="gameTime">Provides a snapshot of timing values.</param>
71 protected override void Update(GameTime gameTime)
73 // Allows the game to exit
74 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
77 // TODO: Add your update logic here
79 base.Update(gameTime);
83 /// This is called when the game should draw itself.
85 /// <param name="gameTime">Provides a snapshot of timing values.</param>
86 protected override void Draw(GameTime gameTime)
88 GraphicsDevice.Clear(Color.CornflowerBlue);
89 spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
93 // TODO: Add your drawing code here