mercredi 19 avril 2017

Difference game in ActionScript3 with text box anwser AIR for Andoird

I'm want to make a game where I have two images and I have to see the differences. And I want it when I finish the time I have to check (text box) the number of differences that exist. (If they decide to move to the next level, in case they miss trying again) All in ActionScript3 for andoird Here is a part of the code:

            stop();

            var myTimer:Timer = new Timer(1000,7); // every second for 60 seconds
            myTimer.addEventListener(TimerEvent.TIMER, onTimer);
            myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
            myTimer.start();

            function onTimer(e: TimerEvent):void {
                tempo.text = String(myTimer.repeatCount - myTimer.currentCount);
                info.text = "Tens 6 segundos para decorar as diferenças";  
            }

            function onComplete(e: TimerEvent):void{
               trace("Acabou");
               carta.gotoAndStop(2);
               carta1.gotoAndStop(2);
                info.text = "Quantas diferenças existem?"; 
                errado.addEventListener(MouseEvent.CLICK, clicked);
                errado1.addEventListener(MouseEvent.CLICK, clicked);
                errado2.addEventListener(MouseEvent.CLICK, clicked);
                certo.addEventListener(MouseEvent.CLICK, clicked1);
            }

            function clicked(MouseEvent){
                gotoAndStop("perdeu");
            }

            function clicked1(MouseEvent){
                nextFrame();
            }

Like this

Aucun commentaire:

Enregistrer un commentaire