Beispiel #1
0
 public Attack(Zombie zombie)
     : base(zombie)
 {
     AttackTimer = new Counter.Timer(this.Game, int.MaxValue);
     AttackTimer.OnMeet +=new Counter.EventOnCounterMeet(OnAttackTimerTick);
     this.Damage = 0;
 }
        public override void Initialize()
        {
            delayTimer = new Counter.Timer(this.Game, delay);
            delayTimer.OnMeet += new Counter.EventOnCounterMeet(delayTimer_OnMeet); ;

            base.Initialize();
        }
Beispiel #3
0
 public Attack(Zombie zombie, Animation image, int damage, float attSpeed)
     : base(zombie, image)
 {
     this.Damage = damage;
     AttackTimer = new Counter.Timer(this.Game, (int)(1000f / attSpeed));
     AttackTimer.OnMeet += new Counter.EventOnCounterMeet(OnAttackTimerTick);
 }
Beispiel #4
0
        public override void Initialize()
        {
            shootTimer = new Counter.Timer(this.Game, shootDelay);
            shootTimer.OnMeet += new Counter.EventOnCounterMeet(shootTimer_OnMeet);

            base.Initialize();
        }
Beispiel #5
0
 public Damaging(Game game, int damage)
     : base(game)
 {
     this.Damage = damage;
     flashTimer = new Counter.Timer(this.Game, 200);
     flashTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnFlashTimerTick);
     this.IsCompleted = false;
 }
Beispiel #6
0
        public override void Initialize()
        {
            sunCreateTimer = new Counter.Timer(this.Game, sunCreateDelay);
            sunCreateTimer.OnMeet += new Counter.EventOnCounterMeet(sunCreateTimer_OnMeet);
            sunCreateTimer.Start();

            base.Initialize();
        }
Beispiel #7
0
 public Damaging(Damaging dam)
     : base(dam.Game)
 {
     this.Damage = dam.Damage;
     flashTimer = new Counter.Timer(dam.flashTimer);
     flashTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnFlashTimerTick);
     this.IsCompleted = false;
 }
Beispiel #8
0
        public LinearWave(LinearWave lnWave)
            : base(lnWave.Game)
        {
            this.ZombiesManager = lnWave.ZombiesManager;
            this.IsCompleted = lnWave.IsCompleted;
            this.generateTimer = new Counter.Timer(lnWave.generateTimer);
            this.totalTimer = new Counter.Timer(lnWave.totalTimer);

            this.generateTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnGenerateTimerTick);
            this.totalTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnTotalTimerTick);
        }
Beispiel #9
0
        public LinearWave(ZombiesManager manager)
            : base(manager.Game)
        {
            this.ZombiesManager = manager;
            this.IsCompleted = false;
            this.generateTimer = new Counter.Timer(manager.Game, int.MaxValue);
            this.totalTimer = new Counter.Timer(manager.Game, 0);

            this.generateTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnGenerateTimerTick);
            this.totalTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnTotalTimerTick);
        }
Beispiel #10
0
 public GrowButton(GrowButton grButton)
     : base(grButton)
 {
     this.Manager = grButton.Manager;
     this.Price = grButton.Price;
     this.CoolDown = new Counter.Timer(grButton.CoolDown);
     this.visualCoolDown = new Counter.Timer(grButton.visualCoolDown);
     this.coolDownImage = new Sprite(grButton.coolDownImage);
     this.visualCoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnVisualCoolDownTick);
     this.CoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnCoolDownTick);
     this.LastCanBuy = grButton.LastCanBuy;
 }
Beispiel #11
0
 public GrowButton(GrowManager manager, Sprite background)
     : base(manager.Game, background, background, Vector2.Zero)
 {
     this.Manager = manager;
     this.Price = 0;
     this.CoolDown = new Counter.Timer(manager.Game, 0);
     this.CoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnCoolDownTick);
     this.visualCoolDown = new Counter.Timer(manager.Game, 0);
     this.visualCoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnVisualCoolDownTick);
     this.coolDownImage = SpriteBank.GetSprite(@"Images\Controls\CoolDown");
     this.LastCanBuy = true;
 }
Beispiel #12
0
        public LinearWave(ZombiesManager manager, int numZombie, int createDelay, int time)
            : base(manager.Game)
        {
            this.ZombiesManager = manager;
            this.IsCompleted = false;
            this.generateTimer = new Counter.Timer(manager.Game, createDelay);
            this.totalTimer = new Counter.Timer(manager.Game, time);
            maxZombie = numZombie;

            this.generateTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnGenerateTimerTick);
            this.totalTimer.OnMeet += new Counter.EventOnCounterMeet(this.OnTotalTimerTick);
        }
Beispiel #13
0
        public override void Initialize()
        {
            this.bulletEngine = new Bullets.B_MineEngine(this.Game, plantManager.GetBulletManager);
            this.range = 1;

            delayGrowUp = 1000;
            growUpTimer = new Counter.Timer(this.Game, delayGrowUp);
            growUpTimer.OnMeet += new Counter.EventOnCounterMeet(growUpTimer_OnMeet);

            shootDelay = 0;

            base.Initialize();
        }
Beispiel #14
0
        public GameScene(SceneManager manager)
            : base(manager)
        {
            //Test:
            this.Background = SpriteBank.GetSprite(@"Images\Controls\Background_Forest");

            this.moveTimer = new Counter.Timer(this.Game, 20);
            this.state = GameSceneState.MoveIn;
            this.moveTimer.OnMeet += new Counter.EventOnCounterMeet(this.MoveIn);
            this.moveTimer.Start();

            this.playButton = new Controls.Button(this.Game, SpriteBank.GetSprite(@"Images\Controls\Ready"), SpriteBank.GetSprite(@"Images\Controls\ReadyOver"), Vector2.Zero);
            this.playButton.Position = new Vector2(-315f, 220f);
            this.playButton.Clicked += new EventHandler(this.PlayButtonOnClick);

            this.Grid = new Griding.Griding(this.Game, new Rectangle(0, 60, 760, 380), 5, 9);
            this.PlantManager = new Plants_Bullets.Plant.PlantManager(this.Game, this.Grid);
            this.GrowManager = new Hospital.Hospital_GrowManager(this.PlantManager);
            this.PlantManager.GetSunManager.OnSunChanged += new SunManager.OnSunChangedProc(this.GrowManager.OnSunChanged);
            this.PlantManager.GetSunManager.NumberOfSuns = 100;

            this.ZombiesManager = new Zombies.Managers.ZombiesManager(this.Grid);
            this.ZombiesManager.Generator = new Hospital.Hospital_ZombiesGenerator(this.ZombiesManager);
        }
Beispiel #15
0
        public override void Initialize()
        {
            animation = SpriteBank.GetAnimation("Images\\Plants\\Sun");
            vBank = Vector2.Zero;
            done = false;
            toBank = false;
            isClicked = false;
            lost = false;

            this.autoRemoveDelay = 5000;
            this.autoremoveTimer = new Counter.Timer(this.Game, this.autoRemoveDelay);
            this.autoremoveTimer.OnMeet += new Counter.EventOnCounterMeet(autoremoveTimer_OnMeet);

            base.Initialize();
        }
Beispiel #16
0
 public Death(Death death)
     : base(death)
 {
     this.IsComplete = death.IsComplete;
     Timer = new Counter.Timer(death.Timer);
 }
Beispiel #17
0
 public Death(Zombie zombie, Animation image, int timeToLive)
     : base(zombie, image)
 {
     this.IsComplete = false;
     Timer = new Counter.Timer(this.Game, timeToLive);
 }
Beispiel #18
0
 public B_DPeaEngine(Game game, BulletManager bulletManager)
     : base(game, bulletManager)
 {
     timer = new Counter.Timer(game, delay);
     timer.OnMeet += new Counter.EventOnCounterMeet(timer_OnMeet);
 }