The theme worked out kinda nice because I was already thinking about making a physics-based game. And I wanted to make a tank, so I started in on the tank.
The tank is 4 parts: the tank body, the gun barrel, three wheels, and an animated tread sprite.
(All sprites shown in this write-up are scaled up 650%.)
The wheels are three separate objects and the tread is just a 3-frame sprite (not an object), but whatever. Anyway, I used the tank body as the base fixture, then created and attached the three wheels and the gun barrel as revolute fixtures. (Actually, I didn't attach the gun barrel this way at first, but I'll talk more about that later.) The tread is just drawn into place. So, there really isn't a tread moving the tank along. It's just wheels covered up by a facade, like a cheap tank toy from the dollar store.
I made a bunch of ground sprites, all using this sprite for the base texture:
This sprite is 32 x 8. I cut this into an 8 x 8, 16 x 8, and a 24 x 8 to make 4 different lengths of ground. I also made slopes of 1 to 1 (45 degree angle), 2 to 1, 3 to 1, and 4 to 1 for both directions with the same dimensions. So, I ended up with 12 different ground objects. However, I didn't use the 45 degree angle (8 x 8 slope) because the tank wouldn't go up the incline very well and had a tendency to tip over. I didn't want to code for tipping over, so I just omitted the 45 degree angle. Also, being pressed and stressed for time, every piece of ground you see in the game is an object.
LOL!
I should have used tile sprites for the ground underneath the top most layer of ground objects (ground that will never be collided with), but it's a jam game and things happen.
Now, I had to get the tank to move around like a tank. I got the wheels turning with the left and right arrow keys and the tank moved back and forth, but it would slide down hills. Even if I increased the density of the tank and the friction of the wheels, it would still slide down the hills. I finally found phy_fixed_rotation and used it on the wheels to turn them on and off depending on whether the player was pressing left or right. That stopped the tank from rolling when not moving. That took a long time for me to figure out.
Time to make the gun barrel move and shoot. Being a noob-iot to physics, I first tried to do this with just a sprite. Got it all working (after much lengthdir hassles)... the barrel would raise and lower, the bomb was coming out the tip, the bomb was finally going in the right direction to match the barrel angle, and it's speed and travel distance were adjusted to a comfortable level. It was just fine, until I noticed that nothing would collide with the gun barrel.
Oops.
So I had to make it a physics object. And I had to use physics code. And I spent FOREVER trying to get the thing to rotate in the right direction and stay relative to the angle of the tank body. It was quite the frustration-fest. When it finally worked, I nearly stopped everything to throw a celebration party.
So, after painfully getting the tank to move correctly using physics code (coding that I've only barely messed around with a couple of times), I needed to make it a game. It was fun to drive around on the slopes and shoot bombs, but there was no game. I needed an enemy.
What better enemies than ninjas? I don't know. There probably isn't. Ninjas are awesome enemies.
What started as a simple sprite, grew into a monster. AI is a cold-hearted, unforgiving... well, you know. I ended up with an action_state, a move_state, and an attack_state... a big mess of code that I just simply got tired of trying to get right. I got it to a place that kinda worked, and the ninja action was kinda funny to me, so I said, “GOOD ENOUGH!” and moved on. It's a jam game and things happen.
It still wasn't a “game” though. Earlier on, I was kinda stumped, so I asked the wife what she thought. She suggested shooting vegetables at the enemy. That sounded fun, so I made sprites for: pea, corn, tomato, potato, turnip, and watermelon. Watermelon? That's not a vegetable, but shooting watermelons sounded like a lot of fun.
At this point, I only had about 7 hours left. There was no way I was going to make all those ammo types available, so they all got scratched. Except for the watermelon. I could make the watermelon be the crux, the thing we're fighting for!
And there's how “Retreadz” came to be.
The last couple of hours was spent on creating the gui elements, implementing the stat screen between the levels, and a mad dash to find some music to try to cover up the deafening lack of sounds. The music helped a lot, but booming sounds, motor sounds, and ninja sounds are sorely missed.
I'm not disappointed. I was only able to use two out of the three days to make this. That third day would have helped a lot. Thanks for reading, hope you enjoyed it. Here's a potato.
Now, to play your games and assign semi-arbitrary number ratings to catagories and write reviews. This should be fun! See you in the voting topic! Good luck to you and your game!