banner
Xiao4-800K

Xiao4-800K

技术分享、闲聊、玩闹

Introduction#

I've been feeling a bit restless lately, so I've been burying myself in coding during my free time. When I get tired of coding, I prepare to draw some game assets, slowly sketching out characters, terrains, and small elements that help me relax.
If you also often feel restless, why not give it a try? Put on your headphones, draw something, write something.

Process Record#

Step 1: Revisit the game and grasp the elements#

I'm actually quite addicted to this game. Sometimes, I can play on a track for a long time. I really enjoy bumping into other cars.
Another thing is the obstacles on the track. There are many different types, and they look interesting. After playing a few rounds again, I basically have the elements.

	Elements:
	1. Tracks: There are five default tracks with a lot of repeated elements.
	2. Motorcycles: The actions of all motorcycles are basically the same, only the colors are different. These motorcycles have collision effects.
	3. Obstacles: If you look closely, you'll see that the obstacles are also made up of many repeated elements.
	4. Custom track functionality.
	5. Single-player mode and PVE mode.
	6. Ranking is determined by time.

Step 2: Project design#

After sorting out the elements, I plan to start copying, ah no, remaking~

Here, I want to make some changes. I hope the motorcycles can fly higher and rotate 360 degrees. The flipping speed of the original version is too slow, so I need to speed it up.
I want the vertical movement to be a bit more flexible, 16 pixels per step is a bit too rigid for a motorcycle. And... if I think too much, it's hard to put it into words. So, let's iterate slowly.

Step 3: Get excited and start development#

1. UI scenes and basic assets can be done in the first part, so the basic framework is established, and various transitions are properly bound.
2. Create basic elements, such as motorcycle elements and terrain obstacle elements, which need to be designed separately. The terrain element is a bit tricky.
3. Implement the basic logic of the track scene. Compared to other parts, this is the most crucial and also the most complicated part. I spent a long time adjusting and testing here.
4. Implement the scoring scene. The character will turn its head, making it more playful.
5. Implement the track design scene. Since I used a logic similar to commands for scene transitions earlier, I found that the commands might not be sufficient when adding this scene. So, I added additional checks in the main scene.
6. Implement robot AI. To be honest, I took a lot of shortcuts here. After all, the original version's robots also look quite stiff.

Step 4: Testing#

Start, single-player mode, multiplayer mode, edit mode... all seem to be working fine. The tracks and obstacles are also good. Ah, this version is good enough to play.

A flowchart to commemorate it.

Testing
Testing
Testing
Testing
Testing
Testing

Final Thoughts#

It took about 9 days to complete this game. I remember the last update was 9 days ago. All things considered, the speed feels decent, not fast but not slow either. After all, I did everything from code to images by myself.
Moreover, I didn't use collision detectors or similar built-in engine functions. Many parts were calculated purely through code, such as the motorcycle's flipping angle when encountering obstacles. I figured out many details little by little.

Take it slow. When I have enough, I can make a multi-in-one cartridge. Of course, there's also the resource address, with the source code and executable in one package, which I've uploaded to CSDN:

https://download.csdn.net/download/at555444/88603000
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.