public EntityManager() { runningSheet = new SpriteSheet(ProjectData.Content.Load<Texture2D>("megamanRun"), 44, 42, ProjectData.GraphicsDevice); jumpSheet = new SpriteSheet(ProjectData.Content.Load<Texture2D>("megamanJump"), 37, 51, ProjectData.GraphicsDevice); koopaSheet = new SpriteSheet(ProjectData.Content.Load<Texture2D>("koopa"), 24, 32, ProjectData.GraphicsDevice); player = new Player(new Vector2(44, LevelManager.CurrentMap.GroundPoint.Y - 42)); enemies.Add(new Koopa(new Vector2(48 * 24, LevelManager.CurrentMap.GroundPoint.Y - 33))); }
public Player(ContentManager content) : base(new Vector2(AsteroidGame.ScreenBounds.Width / 2, AsteroidGame.ScreenBounds.Height / 2)) { topSpeed = 4; SetTexture(content, "player"); gameContent = content; _scale = 0.65f; _mass = 40; // Load the explosion spritesheet and explosion animation explosionSheet = new SpriteSheet(content.Load<Texture2D>("explosion_sheet"), 90, 90, AsteroidGame.graphics.GraphicsDevice); explosion = new Animation(new Texture2D[] {explosionSheet.GetSubImage(0, 0), explosionSheet.GetSubImage(1, 0), explosionSheet.GetSubImage(2, 0), explosionSheet.GetSubImage(3, 0), explosionSheet.GetSubImage(4, 0), explosionSheet.GetSubImage(0, 1), explosionSheet.GetSubImage(1, 1), explosionSheet.GetSubImage(2, 1), explosionSheet.GetSubImage(3, 1), explosionSheet.GetSubImage(4, 1), content.Load<Texture2D>("Blank") , content.Load<Texture2D>("Blank")}, 100f); }
private void InitTileSheet() { tileSheet = new SpriteSheet(ProjectData.Content.Load<Texture2D>("Levels\\TileSheets\\fantasy-tileset"), 32, 32, ProjectData.Graphics.GraphicsDevice); int counter = 0; int y = 0; while (y < tileSheet.Height / tileSheet.SpriteHeight) { for (int x = 0; x < tileSheet.Width / tileSheet.SpriteWidth; x++) { tileTextures.Add(tileSheet.GetSubImage(x, y)); counter++; } y++; } }
protected override void LoadContent() { base.LoadContent(); Art.Load(gameRef.Content); backgroundoverlay = new DrawableRectangle(GraphicsDevice, new Vector2(Game1.GAME_WIDTH, Game1.GAME_HEIGHT), Color.White, true).Texture; SpriteSheet explosionSs = new SpriteSheet(content.Load<Texture2D>("explosion"), 32, 32, gameRef.GraphicsDevice); Texture2D[] imgs = new Texture2D[] { explosionSs.GetSubImage(0, 0), explosionSs.GetSubImage(1, 0), explosionSs.GetSubImage(2, 0) }; var explode = new Animation(imgs); EffectManager.Initialize(content.Load<Texture2D>("particle"), explode); if (singlePlayer) backgroundImage = content.Load<Texture2D>("Screen Images\\apocalypselondon"); }
public static void AddTileSheet(string name, SpriteSheet sheet) { tileSheets.Add(name, sheet); }