objective c - CCProgressTimer doesn't update, then suddenly jumps -
i have following code:
ccprogresstimer *atimer; -(void) generatedungeon { srand (time(null)); [self initdungeonarray]; int numrooms = rndm(10,100); (int a=0; a< numrooms; a++) { [self makerandomroom]; atimer.percentage += 100/numrooms; } [self connecttherooms]; [self placestairs]; } the problem during loop timer not updated on screen, (after loop finishes think) fills full. don't understand why happening. thought when change percentage, image update.
can me understand should understanding?
thanks.
your image(in case, progress timer), updates on screen in draw() , visit() methods. called every tick. here change it's value in 1 tick. during previous drawing timer value 0 percent, , on next drawing it's value 100
you make in single thread. timer not update in case. create updatable timer, can try move long working code separate thread. able update timer.
Comments
Post a Comment