samedi 5 mai 2018

How to create a random race track for SpriteKit?

I want to create a racing game with a racetrack that gets generated randomly.

Here is a sketch of how I want it to be:

Racetrack sketch

I want the racetrack to be a physics body. While the racetrack moves to the left side of the screen it changes it gets generated on the right screen but with random directions(curves) like displayed in the sketch. If the car at some point touches the edge of the road the game ends.

The only thing I need help with right now is how to generate the road as described above.




Aucun commentaire:

Enregistrer un commentaire