1011
1
package Class.Screens {
1
package Class.Screens {
2
 
2
 
3
    import Class.Enemies.NormalEnemy;
3
    import Class.Enemies.NormalEnemy;
 
 
4
    import Class.Item.Bubblegum;
4
    import Class.Item.Slot;
5
    import Class.Item.Slot;
5
    import Class.Main.*;
6
    import Class.Main.*;
6
 
7
 
...
 
...
 
95
 
96
 
96
            Main._stageRef.addEventListener(MouseEvent.MOUSE_DOWN, charging);
97
            Main._stageRef.addEventListener(MouseEvent.MOUSE_DOWN, charging);
97
            Main._stageRef.addEventListener(MouseEvent.MOUSE_UP, charging);
98
            Main._stageRef.addEventListener(MouseEvent.MOUSE_UP, charging);
 
 
99
            Level._level.itemAreaHit.addEventListener(MouseEvent.CLICK, checkIfHaveItensBeingUsedOnStage);
98
 
100
 
99
            //Variável para verificar se o jogo está rodando ou não
101
            //Variável para verificar se o jogo está rodando ou não
100
            RUNNING = true;
102
            RUNNING = true;
...
 
...
 
103
            this.addEventListener(Event.ACTIVATE, resumeGame);
105
            this.addEventListener(Event.ACTIVATE, resumeGame);
104
        }
106
        }
105
 
107
 
 
 
108
        private function checkIfHaveItensBeingUsedOnStage(e:MouseEvent):void 
 
 
109
        {
 
 
110
 
 
 
111
            if (Level._itemActivedType != "")
 
 
112
            {
 
 
113
 
 
 
114
                switch(Level._itemActivedType)
 
 
115
                {    
 
 
116
                    case "bubblegum":
 
 
117
                        var bubblegum:Bubblegum = new Bubblegum(Level._level.mouseX, Level._level.mouseY);
 
 
118
                        Level._arrayOfItensBeingUsed.push(bubblegum);
 
 
119
                        Level._itemActivedType = "";
 
 
120
                        break;
 
 
121
                }
 
 
122
                Level._activeSlot.cleanSlot();
 
 
123
            }
 
 
124
 
 
 
125
        }
106
 
126
 
 
 
127
 
107
        private function timerHandler(e:TimerEvent):void 
128
        private function timerHandler(e:TimerEvent):void 
108
        {
129
        {
109
            var _currentTime = 500 * _timeCount;
130
            var _currentTime = 500 * _timeCount;