I am working on a practice project being recreated by a class of elementry aged coders this spring. It is a simple tilemap with a car navigating obstacles. The goal is to teach them how the programs works and how to fix minor issues in their projects. Many of them have little experience with tech whatsoever. In making this practice project I have run into a little problem. I have coded it to move through obstacles, move forward at a stable pace, have a defined start and end, ect.
Can y’all help me add to the code so that when the students hit a wall it reverses for a second or two, and then starts forward again… I have so much trouble with the pause and restart mechanics!
I installed the timer extension and made a on game update block that handles the logic
If you want to modify how far back the car moves before resuming, just change the timer. You can also add a second timer to make the car wait before turning around. Hope this helps!
Then, since the pause block would pause the game entirely, it would just pause the game, then after 300ms, it would unpause and have the car go forward.
If you would like to know how to put the extension on a project, click the extensions choice in the toolbox:
I’m late to the party here, but the ‘on overlap end tile’ block wasn’t registering because the type of the sprite has to be car (not player) and when the car hits the end tile, it will actually be at the car’s center rather than its right.
With those changes it works for me now
It’s because you are triggering it in a weird way. You have it so that when the car hits a wall, you check if the tile to the right is the end tile. It’s not working because the tile isn’t marked as a wall in the first place. But instead of going back to the tilemap and doing that, there’s a much simpler way to write this code: