public override void LoadContent() { var sprites = new SpriteSheet("sprites/cannon.ss", new SpriteSheetParams(0, 0, 192, 192, 3, 3)); sprites.LoadContent(); sprites.Initialize(); var direction = this.parameters.Direction; var animDirection = direction.X == -1 ? 0 : 1; var spritesAnimBlast = sprites.GetSpriteSequenceOfLine(animDirection, 3); this.animations = new SpriteAnimation[2]; this.animations[ANIM_BLAST] = new SpriteAnimation(spritesAnimBlast, speed: 25, loop: false); this.animations[ANIM_STANDBY] = new SpriteAnimation(new Sprite[] { spritesAnimBlast[0] }); var cannonSourcePos = this.position; if (direction.X == 1) { cannonSourcePos.X += this.animations[ANIM_STANDBY].CurrentFrame.Bounds.Width; } this.bomb = new Bomb(cannonSourcePos, direction, Constants.M * parameters.DistanceOfShot); this.bomb.LoadContent(); GameManager.Sound.LoadSFX(Constants.SFXAssets.BOMB_EXPLOSION); this.fireBombTask = Wait.Milliseconds((int)this.parameters.ThrowFrequency.TotalMilliseconds).Then(Fire); this.debug = GameManager.Services.GetService <IVisualDebugService>(); }
public override void LoadContent() { this.mind = new PlayerMind(this); this.debug = GameManager.Services.GetService <IMessageDebugService>(); this.visualDebug = GameManager.Services.GetService <IVisualDebugService>(); GameManager.Sound.LoadSFX(Constants.SFXAssets.PLAYER_DEATH); GameManager.Sound.LoadSFX(Constants.SFXAssets.FALLING); this.destinationIndicator = new PositionIndicator(); this.AddChild(this.destinationIndicator); this.AddChild(this.mind); base.LoadContent(); }
public override void LoadContent() { this.map = GameManager.Content.Load <TiledMap>(this.mapName); this.Bounds = new Rectangle(0, 0, this.map.WidthInPixels, this.map.HeightInPixels); this.renderer = new TiledMapRenderer(GameManager.GraphicsDevice); this.collisionWorld = new CollisionWorld(Vector2.Zero); var collisionLayer = this.map.GetLayer <TiledMapTileLayer>(LAYER_COLLISION); if (collisionLayer != null) { PrepareCollisionGrid(collisionLayer); } this.collisionActors = new List <IActorTarget>(); #if DEBUG this.debug = GameManager.Services.GetService <IVisualDebugService>(); #endif this.PrepareSpecialAreas(); this.PrepareEnemiesList(); this.PreparePlayableZones(); }