public void ExplosionBomb(PhysicalObject bomb)
        {
            var temp = bomb as Bomb;

            temp.isBlowedUp = true;
            scriptEngine.StartSimpleScript(temp, DeleteBombFromField, 100, 3);
        }
        public void OnDeathPlayer(PhysicalObject player)
        {
            var temp = player as Player;

            scriptEngine.StartSimpleScript(temp, playerOnDeathSize, DeletePlayerFromField, 200, 6);
            temp.IsDying = true;
            temp.isMoved = false;
        }
Example #3
0
        public SimpleScript(PhysicalObject obj, Image sprite, ScriptEngine.OnEndFunc onEndFunc, int countStates, int delay)
        {
            currTimer = new Timer();

            currTimer.Interval = delay;

            this.obj = obj;

            this.onEnd        = onEndFunc;
            this.countStates  = countStates;
            this.currState    = this.countStates;
            this.sprite       = new Bitmap(sprite as Bitmap);
            this.onScriptSize = obj.size;

            currTimer.Elapsed += OnTimerEvent;
        }
        public void StartSimpleScript(PhysicalObject obj, Image sprite, Size onScriptSize, OnEndFunc onEndFunc, int delay, int countStates)
        {
            SimpleScript states = new SimpleScript(obj, sprite, onScriptSize, onEndFunc, countStates, delay);

            states.currTimer.Enabled = true;
        }