Bubble popping animation

In a full program state refers to different screens (start screen / Game / Help Screen / High score screen) or major situations of the sketch.

Here, state is the situation/ state of one bubble (raises or popped…)

It’s nothing complicated.

It just stores whether you clicked a bubble and then whether it’s exploded or sinking or dead. You store this information in int state and when it changes (in an explosion all shrapnels vanished) you change state accordingly (bubble is dead).

You also act on state (act accordingly to state), so when state is bubble, show bubble, when state is explode, show explosion.

It’s just a simple way to make animation with different steps/phases/situations/states.

1 Like