/*** Default Constructor ***/ public Pacman() { pos = new Vector2(0, 0); vel = new Vector2(0, 0); image = null; game_grid = null; coll_trig_x = 0; coll_trig_y = 0; }
public Pacman(int pdim, int world_width, int world_height, Tiles grid) { p_dim = pdim; wwidth = world_width; wheight = world_height; pos = new Vector2(0, 0); vel = new Vector2(0, 0); image = null; game_grid = grid; coll_trig_x = 10; coll_trig_y = 10; curr_direction = ""; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //Initialize the level grid game_grid = new Tiles(); font = Content.Load<SpriteFont>("Score"); pacman = Content.Load<Texture2D>("ball"); empty = Content.Load<Texture2D>("Empty"); pellet = Content.Load<Texture2D>("Pellet"); pill = Content.Load<Texture2D>("Pill"); wall = Content.Load<Texture2D>("Wall"); wall_up = Content.Load<Texture2D>("Wall_up"); wall_down = Content.Load<Texture2D>("Wall_down"); wall_left = Content.Load<Texture2D>("Wall_left"); wall_right = Content.Load<Texture2D>("Wall_right"); wall_tlc = Content.Load<Texture2D>("Wall_tlc"); wall_trc = Content.Load<Texture2D>("Wall_trc"); wall_brc = Content.Load<Texture2D>("Wall_brc"); wall_blc = Content.Load<Texture2D>("Wall_blc"); wall_blci = Content.Load<Texture2D>("Wall_blci"); wall_tlci = Content.Load<Texture2D>("Wall_tlci"); wall_trci = Content.Load<Texture2D>("Wall_trci"); wall_brci = Content.Load<Texture2D>("Wall_brci"); test = Content.Load<Texture2D>("Empty2"); //Load the images into the level grid game_grid.load_images(empty, pellet, pill, wall, wall_up, wall_down, wall_left, wall_right, wall_tlc, wall_trc, wall_blc, wall_brc, wall_blci, wall_brci, wall_tlci, wall_trci); //Code the level onto the game grid game_grid.load_level(); //Initialize pacman player = new Pacman(p_dim, world_width, world_height, game_grid); //Set Pac-Man to his starting position player.pos.X = game_grid.tile_grid[13, 26].pos.X+10; player.pos.Y = game_grid.tile_grid[13, 26].pos.Y-10; //Set Pacman image player.image = pacman; // TODO: use this.Content to load your game content here }