How to create laps in CoSpaces


#1

Me and my group are creating a racing game for an assignment. On one of our levels, we want to have multiple laps, and on lap three, to start testing for the win condition. Any help?


#3

HI @Alejandro_Salazar,

You can add a lap count variable and increase it on every lap. The easiest way is to place an invisible wall and increase the variable when the racing object collides with the wall. But the car can simply ride through the starting gate there and back. It can be fixed if you place a gate on another side of the track and check the last passed gate.

I created a sample scene for you where you can see that, you can remix it and see the code.
Car is controlled by arrow keys up-right-left-down.

We would be happy to see the game created by your group!