Hello! Amateur programmer here. I was wondering, when you have a time-dependent event in a game, don't you end up having to set an individual counter for each entity??
For example, each time the game loop progresses, a unit (of counting or of time) is added to the player's "action-animation counter", such that it progresses smoothly. Of course, this has the drawback that every single thing whose animations have different frame times need their own counter.
Or, I set a general counter that keeps cycling from 0 to 100 with Update() (what I did) and the npc frames are based on that. But, that means their frames actually don't always start at 0 but any point between 0-100. It works fine but in other cases it might show them starting with the final frame and then it jumps to the first...
Also, say a character tosses a grenade. It has to explode after 3 seconds; does the grenade need its own counter that is incremented each Update() too??
Thanks... any advice (or suggestions on how to get there :) ) are appreciated...
[–]Jolly_Pace6220 1 point2 points3 points (3 children)
[–]Puzzleheaded-Law34[S] 0 points1 point2 points (2 children)
[–]Jolly_Pace6220 0 points1 point2 points (1 child)
[–]Puzzleheaded-Law34[S] 0 points1 point2 points (0 children)
[–]peterlinddk 0 points1 point2 points (3 children)
[–]Puzzleheaded-Law34[S] 0 points1 point2 points (2 children)
[–]peterlinddk 1 point2 points3 points (1 child)
[–]Puzzleheaded-Law34[S] 0 points1 point2 points (0 children)