Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. public class Game1 : Microsoft.Xna.Framework.Game
  2. {
  3.  
  4. Pacman pacman;
  5.  
  6. _________________________________________________
  7.  
  8. protected override void LoadContent()
  9. {
  10. // Create a new SpriteBatch, which can be used to draw textures.
  11. spriteBatch = new SpriteBatch(GraphicsDevice);
  12.  
  13. pacman = new Pacman(texture, pos);
  14. map = new Map(texture, new Vector2(0, 55), ref pacman);
  15.  
  16. __________________________________________________
  17.  
  18. protected override void Update(GameTime gameTime)
  19.  
  20.  
  21. switch (current_state)
  22. {
  23. case GameState.level1:
  24. {
  25. pacman.Update();
  26. map.Update();
  27.  
  28. }
  29. break;
  30. ___________________________________________________
  31. protected override void Draw(GameTime gameTime)
  32. {
  33. GraphicsDevice.Clear(Color.Black);
  34.  
  35. spriteBatch.Begin();
  36.  
  37. case GameState.level1:
  38. {
  39. map.Draw(spriteBatch);
  40. spriteBatch.Draw(score_bar, new Vector2(90, 5), Color.White);
  41. spriteBatch.DrawString(font, " " + map.lives, new Vector2(270, 3), Color.Blue);
  42. spriteBatch.DrawString(font, " " + map.score, new Vector2(510, 3), Color.Blue);
  43. pacman.Draw(spriteBatch);
  44. }
  45. break;
  46.  
  47. spriteBatch.End();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement