Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Map
- {
- protected Texture2D texture;
- protected Vector2 pos;
- StreamReader sr;
- String str;
- Entity[,] map_objects;
- Pacman Pacman;
- public Map(Texture2D texture, Vector2 pos, ref Pacman pacman)
- {
- this.pacman = pacman;
- this.texture = texture;
- this.pos = pos;
- }
- _________________________________________________________
- public virtual void Update()
- {
- if (food <= 0 && Game1.current_state == Game1.GameState.level1)
- {
- pacman.pos = new Vector2(305, 500);
- //Create_level2();
- Game1.current_state = Game1.GameState.winning;
- }
- ___________________________________________________________
- public void CreateLevel1()
- {
- //if (str[j] == 'P')
- {
- map_objects[j, i] = new Pacman(texture, new Vector2(pos.X + size * j, pos.Y + size * i));
- }
- ____________________________________________________________
- public virtual void Draw(SpriteBatch spriteBatch)
- {
- foreach (Entity objects in map_objects)
- {
- if (objects != null)
- objects.Draw(spriteBatch);
- pacman.Draw(spriteBatch);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement