Today I am going to show you the code for creating subway surfer or temple run like game. You can update this code and make it lot better as per your requirement.
Download template: Download Royalty Free Capx file
Play game here.
Click here to play
Game will look like this:
This game is made into two main parts.
1. Start screen
2. Gameplay screen.
Start screen code:
Gameplay screen code:
1. Create player with platform behavior. Then create button actions. You can see that in the screenshot.
2. Create object for collision cone and sprite 4 (barrier) object.
3. Then set code for collision of cone & sprite 4 (barrier) object. Also see motion angle in screenshot.
4. Final code part