Hi,
Some ideas :
- If you want to do something every x seconds, you are going to need a way to measure time pretty much like a counter. You can take a look at a previous answer I gave here :
-
For the display part, if you want your code to be modular, for example be able to add, swap and remove steps from your story and have text/images to appear, you are going to need to store them inside a list or some iterable data structure.
A pseudo code would be (using JS objects) :
const steps = [ {text: "In a galaxy far, far away..."}, {image: "image_1.png"}, {blank: true}, {text: "Yoda is cool", image: "yoda.png"}, // ... ];
Have fun!