Devlog - Pit Crew part 7

Now the cars have suspensions! Sort of.


Friday, July 21, 2023


Devlog - Pit Crew part 6

wc

This program is starting to get pretty big.

I have learned that the thing about sprites is that you need to clean them up yourself. I’ve gotten to a point where sideloading it into the physical Playdate is no longer a waste of time. The game actually feels pretty good to play but I noticed that after a while things got slower and slower. This was not a problem on the simulator because the simulator runs at your computer’s clock speed while the Playdate is much less powerful. Each car consisted of around 7 to 19 individual sprites (the car, two wheels, and the nuts on each wheel), and each time another car came in, the old one was still there off frame.

That was where I discovered that merely removing references to sprites was not enough to mark them for garbage collection. Internally, the Playdate was still tracking them off frame. You need to manually call sprite:remove() on them to remove them from the draw list.

This was a fun problem because my custom sprite objects had child sprites that also needed removing, so I had to override each object’s remove() function to cascade the removal all the way down to the nuts.

So now it’s running nice and smooth across both platforms. Next up, I need to figure out how text works so I can display a timer.


Thursday, July 20, 2023


Devlog - Pit Crew part 5

It’s kind of annoying when you need to rewrite your code, and in the end your program just looks the same (hopefully) for all the work you did.

At least I got to try making a git branch. Not many excuses to do so at this scale.

git pull

I swear, one of these days I’ll figure out what any of this means.


Sunday, July 16, 2023


Devlog - Pit Crew part 4

At this point it’s time for a nearly-full rewrite. I don’t know how to do this other than to just break the main update loop, and let all the fixes trickle down from there. Well, here goes.


Friday, July 14, 2023


Devlog - Pit Crew Part 3

Getting to this point has been a bit of a pain in the ass of my own making. Till now I had been tracking the front wheel as the main object of interaction for the game, but now that I need to add the rest of the car, it raises a lot of annoying questions. Does the car belong to the wheel, or does the wheel belong to the car? Should I only need to update one object and have it propagate down, or just update everything directly from the main loop?

Currently I’m stuck with a mix of both. The wheel is still the main object, and the rest of the car is just a giant sprite that gets dragged along with it whenever it moves. It works alright for now but I’m going to need to reckon with this when it comes time to add the animation to jack the car up and down.


Thursday, July 13, 2023