Home > other >  Cocos2d lua small white questions, ask the great spirit
Cocos2d lua small white questions, ask the great spirit

Time:09-21

Rookie, recently, I didn't understand is cocos2d lua doing freak math every time was determined to several label assignment will overlap very headache, and won't do that for a second countdown, the code is as follows:
Self. Btn1: addTouchEventListener (function (sender, state)
If the state==2 then
If arr [5]==arr [4] then
The local arrR=self: createRandomNum ()
Self. Label1: setString (arrR [1])
Self. Label2: setString (arrR [2])
Self. Label3: setString (arrR [3])
Self. Label5: setString (arrR [5])
Right=Right + 1
Print (Right)
The else
The local GameOver=the require (" GameOver. Lua ")
The local gameover=gameover: the create ()
Cc. Director: getInstance () : replaceScene (gameover)
End
End
End)

CodePudding user response:

I also need to answer

CodePudding user response:

Accidentally hit the wrong embarrassed

CodePudding user response:

Can add a timer Schedule, call once per second, determine correct mistakes in the calling function is ok,

CodePudding user response:

reference 4 floor wangpeng1530 response:
can add a timer Schedule, call once per second, determine the correct mistakes in the calling function is ok,

thanks
  • Related