Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Game1 : Microsoft.Xna.Framework.Game
- {
- Pacman pacman;
- _________________________________________________
- protected override void LoadContent()
- {
- // Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = new SpriteBatch(GraphicsDevice);
- pacman = new Pacman(texture, pos);
- map = new Map(texture, new Vector2(0, 55), ref pacman);
- __________________________________________________
- protected override void Update(GameTime gameTime)
- switch (current_state)
- {
- case GameState.level1:
- {
- pacman.Update();
- map.Update();
- }
- break;
- ___________________________________________________
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.Black);
- spriteBatch.Begin();
- case GameState.level1:
- {
- map.Draw(spriteBatch);
- spriteBatch.Draw(score_bar, new Vector2(90, 5), Color.White);
- spriteBatch.DrawString(font, " " + map.lives, new Vector2(270, 3), Color.Blue);
- spriteBatch.DrawString(font, " " + map.score, new Vector2(510, 3), Color.Blue);
- pacman.Draw(spriteBatch);
- }
- break;
- spriteBatch.End();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement