I have an idea how I want to approach this, but I'm not sure if it is perfect. For example, in the event of an event, if the player wins, a bunch of sparks flies for 1 second. I was thinking of creating my own class of game engine, and then creating a base class of a game event, which has 3 functions void, update, draw, render. Maybe, for example, fireforks to collect 100 coins in 3 seconds. The way I want to implement this is to have an event vector in my game engine where I can push the fireforks animation. Once, something is inserted into the vector, the game makes the [i] .render () event, etc ... deleting it, I thought that each event can have the length of the event in frames, and each uint frame is incremented, if uint matches the length, it is set from the vector. I was just not sure what to do, as it was in the best way.
thanks
source
share