1 Reply Latest reply on Mar 3, 2013 7:24 AM by Ned Murphy

    complete game within 20 sec

    mandar vedak Level 1

      game limit is 1 min but if user will complete game within 20 sec then he will get 500 bonus points

       

      how to code for this


      //this is count up timer script

      var intID;

      var endTime = getTimer()+(59*1000);

      makeTime();

      function updateTimer() {

        var t = endTime-getTimer();

        if (t>0) {

        makeTime();

        showTime(t);

        } else {

        stopTimer();

        showTime(0);

        gotoAndStop("over");

        trace("lost");

        }

      }

      function makeTime() {

      clearInterval(intID);

      intID = setInterval(updateTimer, 100);

      }

      function stopTimer() {

        clearInterval(intID);

      }

      function showTime(t) {

        dispTime.text = (t/1000) >> 0;

      }