Just a little question

Is there a way to force the code in a function to wait a little, for example: A jumping system that only works every 2 seconds.

Cheers
Martin :slight_smile: :slightly_smiling_face:

If you want to run a function at some interval, check out the setInterval() function. We used it to launch fruit in chapter 14 (The Purple Fruit Monster) and to perform power-ups in Chapter 18 (Two Player Game).

-Chris

I was working on a game that was inspired by flappy bird.
I made a function to create new pipes for the player to dodge.
How do I make it so that the pipes move towards the player.
How do I generate new pipes with a random height and hole between the pipes.

My code URL is: https://is.gd/XqRZxu