/// <summary> /// Loading Content /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); floorTexture = Content.Load <Texture2D>(@"Content\textures\texturefloor"); wallTexture = Content.Load <Texture2D>(@"Content\textures\texturewall"); spriteSheet = Content.Load <Texture2D>(@"Content\textures\spritesheet"); Maps.Add(Content.Load <Texture2D>(@"Content\maps\4")); Spawns.Add(Content.Load <Texture2D>(@"Content\maps\2")); myMap = new Map(16, 16, Maps[0]); GamePlaying.StartSession(myMap, camera); base.LoadContent(); }
/// <summary> /// ticks /// </summary> protected override void Update(GameTime gameTime) { switch (myGameState) { case GameState.startMenu: //menu update break; case GameState.gamePlaying: GamePlaying.Update(gameTime); break; default: break; } }
/// <summary> /// Draw /// </summary> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black); spriteBatch.Begin(transformMatrix: camera.GetViewMatrix()); switch (myGameState) { case GameState.startMenu: //menu draw break; case GameState.gamePlaying: GamePlaying.Draw(gameTime, spriteBatch); break; default: break; } spriteBatch.End(); }