How do I create a code to make a secondary character move constantly?

Started by BowsetteGamer, Thu 12/12/2024 22:10:07

Previous topic - Next topic

BowsetteGamer

Hello guys, how are you, my secondary character, I configured it but he stays still, he doesn't move constantly.
Without the game freezing, that is, I put it on standby mode



6:05 PM I already solved the problem but I would like to know your opinion

Rik_Vargard

I use a timer for that:

Code: ags
SetTimer (1,80); // After Fade In

if (IsTimerExpired (1)) // in repeatedly_execute
{
 if (cChar.x == 1000) cChar.Walk (1200, 527, eNoBlock, eAnywhere);
 else cChar.Walk (1000, 527, eNoBlock, eAnywhere);
 SetTimer (1,120);
}

This way, I can also choose how long cChar will stay in place before moving again.

SMF spam blocked by CleanTalk