/// <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); Spritesheet = Content.Load<Texture2D>(@"SpriteSheet"); pizzaguy = new PizzaGuy(new Vector2(0, 0), Spritesheet, new Rectangle(380, 225, 30, 35), Vector2.Zero); // TODO: use this.Content to load your game content here }
public Ghost( Vector2 location, Texture2D texture, Rectangle initialFrame, Vector2 velocity, xTile.Layers.Layer map, PizzaGuy pacman) : base(location, texture, initialFrame, velocity, map) { this.pacman = pacman; }
/// <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); Spritesheet = Content.Load<Texture2D>(@"SpriteSheet"); map = Content.Load<Map>("pacmanmap"); menuMusic = Content.Load<Song>("introMusic"); map.LoadTileSheets(xnaDisplayDevice); MediaPlayer.Play(menuMusic); pizzaguy = new PizzaGuy(new Vector2(32, 32), Spritesheet, new Rectangle(300, 300, 32, 32), Vector2.Zero, map.GetLayer("untitled layer")); ghost = new Ghost(new Vector2(32, 32*10), Spritesheet, new Rectangle(500, 300, 32, 32), Vector2.Zero, map.GetLayer("untitled layer"), pizzaguy); // TODO: use this.Content to load your game content here }
/// <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); PacmanSheet = Content.Load<Texture2D>("PacmanSprites"); pacman = new PizzaGuy(new Vector2(300, 300), PacmanSheet, new Rectangle(114, 13, 38, 39), new Vector2(32,0)); pacman.AddFrame(new Rectangle(18, 13, 34, 37)); pacman.AddFrame(new Rectangle(74, 13, 27, 38)); pacman.AddFrame(new Rectangle(18, 13, 34, 37)); }