Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. class Map
  2. {
  3.  
  4. protected Texture2D texture;
  5. protected Vector2 pos;
  6.  
  7. StreamReader sr;
  8.  
  9. String str;
  10.  
  11. Entity[,] map_objects;
  12.  
  13. Pacman Pacman;
  14.  
  15. public Map(Texture2D texture, Vector2 pos, ref Pacman pacman)
  16. {
  17. this.pacman = pacman;
  18. this.texture = texture;
  19. this.pos = pos;
  20. }
  21.  
  22. _________________________________________________________
  23. public virtual void Update()
  24. {
  25. if (food <= 0 && Game1.current_state == Game1.GameState.level1)
  26. {
  27. pacman.pos = new Vector2(305, 500);
  28. //Create_level2();
  29. Game1.current_state = Game1.GameState.winning;
  30.  
  31. }
  32.  
  33. ___________________________________________________________
  34. public void CreateLevel1()
  35. {
  36. //if (str[j] == 'P')
  37. {
  38. map_objects[j, i] = new Pacman(texture, new Vector2(pos.X + size * j, pos.Y + size * i));
  39. }
  40.  
  41. ____________________________________________________________
  42. public virtual void Draw(SpriteBatch spriteBatch)
  43. {
  44.  
  45. foreach (Entity objects in map_objects)
  46. {
  47. if (objects != null)
  48. objects.Draw(spriteBatch);
  49.  
  50. pacman.Draw(spriteBatch);
  51.  
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement