Discord
Login
Community
DARK THEME

Timings and one Time Actions

Hello community,

whats your philosophy for time in game programing? I am not a studied programer, but i managed to do it like this:

Set a counter to 0 in the init unit. Then count +1 in the update unit, if the counter reaches one point divided/60 (for seconds) sth. happens. After all, i set the counter to 0 again, and the loop starts again. But what can i do with one time actions?

For instance, the player is moving to a switch and a door opens. Is there a possibility to do things only once?

Thanks for your answers and have a good time :)

Like store if something was already done?

I know, that i could store a variable, like door open / true or false. But what is with the animation? The opening of the animation should only draw once, slowly, so the player can see the opening of the rock/door.

Another task, an information given by a npc-character should only given out once. How are you doing this?

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community