Sure, but be careful how you use the taskMgr. The code you have will perpetually call “myPeriodicFunc()” every 10 seconds until you remove the task from the taskMgr. Returning “task.again” tells the taskMgr call the function again after the specified amount of time. If you just want it to be called only once after 10 seconds, you could do something like this:
Notice three things:
-the lack of the “task” parameter to our function
-the absence of the “task.again” in the return statement
-the extra “[]” argument to the doMethodLater() call.
This is the simplest way to use the doMethodLater() function. So if you were to write a function that reset your game, you could indeed call it inside meDelayedFunc().
thanks for the reply! you’re giving me too much credit though lol. my really question ws actually, how do i reset my game? im a complete noob and i cant find anything to even start making a function that will reset my game lol.
Panda doesn’t really provide a “resetGame()” function, since it has no idea what it means for your game to be reset. It could be as simple as resetting a score, moving ralph back to his starting position, and resetting his health or something. It all depends on the needs of your game.
Once you’ve defined that, you could wrap it all up in a function call, and you should be good to go. Good luck!