Beispiel #1
0
 public MotherShip(string i_AssetName, GameScreen i_GameScreen)
     : base(i_AssetName, i_GameScreen)
 {
     r_RandomBehavior   = this.Game.Services.GetService(typeof(IRandomBehavior)) as IRandomBehavior;
     r_MaxLives         = Lives;
     this.MoveDirection = Sprite.Right;
     this.Visible       = false;
 }
Beispiel #2
0
 public EnemyManager(GameScreen i_GameScreen) : base(i_GameScreen.Game)
 {
     r_AliveEnemyIndices = new List <KeyValuePair <int, int> >();
     r_GameScreen        = i_GameScreen;
     r_EnemyMatrix       = new List <List <Enemy> >(k_MatrixRows);
     r_RandomBehavior    = this.Game.Services.GetService(typeof(IRandomBehavior)) as IRandomBehavior;
     r_SoundManager      = this.Game.Services.GetService(typeof(SoundManager)) as ISoundManager;
     r_MotherShip        = new RedMotherShip(r_GameScreen);
     this.DrawOrder      = this.UpdateOrder = 5;
     r_GameScreen.Add(this);
 }
Beispiel #3
0
        public Bullet(Color i_TintColor, GameScreen i_GameScreen)
            : base(k_GraphicPath, i_GameScreen)
        {
            r_RandomBehavior = this.Game.Services.GetService(typeof(IRandomBehavior)) as IRandomBehavior;

            this.Width     = 6;
            this.Height    = 16;
            this.Enabled   = false;
            this.Visible   = false;
            this.TintColor = i_TintColor;
            this.Velocity  = new Vector2(k_XVelocity, k_YVelocity);
        }
Beispiel #4
0
 private void CreateBehaviors()
 {
     randomBehavior   = (randomBehavior == null) ? ContainerConfig.GetInstance <IRandomBehavior>() : randomBehavior;
     targetedBehavior = (targetedBehavior == null) ? ContainerConfig.GetInstance <ITargetedBehavior>() : targetedBehavior;
 }