• Create Account

### #ActualNuLogic

Posted 22 April 2012 - 06:13 AM

Hmm, there is main thread, which controls animator function, but to create another thread to do such thing, I think is not ergonomic. And yes, it is a turn based game, player hits, enemy counter-attacks. And please, tell me more about flags, because currently character object reacts on key presses and immediately executes some functions like attack, jump and change image. I tried to delay enemies attack action in such way:
if(ENTER pressed) {
executionTime = currentSystemTime + 1000; // delay for 1 sec
}
if(ENTER pressed && currentSystemTime >= executionTime) { attack }

but it simply doesn't works, it is only performed once (execution time is equal to current time) and later execution time is always greater than current system time. So could you tell me more about game states? I understand, that after certain action it should change, but how it is performed? I mean technically, game sleeps during state change or what?

### #1NuLogic

Posted 22 April 2012 - 06:11 AM

Hmm, there is main thread, which controls animator function, but to create another thread to do such thing, I think is not ergonomic. And yes, it is a turn based game, player hits, enemy counter-attacks. And please, tell me more about flags, because currently character object reacts on key presses and immediately executes some functions like attack, jump and change image. I tried to delay enemies attack action in such way:
if(ENTER pressed) {
executionTime = currentSystemTime + 1000; // delay for 1 sec
}
if(ENTER pressed && currentSystemTime > executionTime) { attack }

but it simply doesn't works. So could you tell me more about game states? I understand, that after certain action it should change, but how it is performed? I mean technically, game sleeps during state change or what?

PARTNERS