Increase the speed for a certain time

car racing game
Want to increase the speed of a car for a certain time?
Why hurry up and stop?
Where is the error in the code?

Put the timer events outside the collision events so the timer can run even if the Player is not in collision with the speed otherwise what you are doing is to reset the timer in the collision but not giving time to check.
Plus 120 seconds is a lot of time for a power up speed try lower number like 10 and check if works fine then change to 120 if you want
So the logic will be Player collides with speed then Reset timer and apply position of background2.Y() wait for the timer to reach 10 seconds and take the background2.y() +=12 and Delete or pause the timer.

It didn’t work for me :weary:

It’s like this:
Drag this event out of the another event.

1 Like

Hi, not that way, this way

But in the second event change the 0 value to something bigger like 10, or 20 or 30 seconds and the check if works.

Doing this you’re telling this:
if Player is in collision with speed
Reset speed1 so the timer starts
And here change the background speed +=15

Once the timer is running then you do some check with the second event so let’s check
if the time of the timer speed1 is greater than x seconds
Pause the timer speed1
And here change the background speed +=12

One thing that I don’t if the speed is an item if so you need to add Delete when the player is in collision with it, that should be done in the first event.
just Add speed Delete.


Here look I made an example of this

1 Like

@UlisesFreitas @Muzan
okay done
many thanks :blush:


beautiful jigsaw puzzle " A Pixel Adventure - Alanna - The princess of puzzles"

If you explain in your channel the installation code only for puzzle
Because I looked for it and couldn’t find it :hugs:

Well it’s a mix of various puzzles

But the added draggable behavior and do some checks to see if the puzzle pieces match the background image.

I don’t mean like this
I mean this
Drag and drop