Time: 20:24
Fun, yet exhausting day. Just doing the 20 minutes. Found a GitHub client. More iterations until Commitopia comes to life.
Fun, yet exhausting day. Just doing the 20 minutes. Found a GitHub client. More iterations until Commitopia comes to life.
As I mentioned earlier, I wanted to display playable demos for the committed state of each day in my blog. So you can play the game I had at day 3, or day 60, or whatever.
Today, I brainstormed how I want that to work. I call it Commitopia.
I’ll continue tomorrow.
Pretty strong animation and sound effect combo. I am proud of my use of frame counting. There’s an even better way I can think of to do the chug sound, but I will leave that alone for now.
Tomorrow, I will plan out how to make my day commits playable. (Again.)
Found a simplification.
The code originally stored boxcar locations on two independent axes (x and y). This is too complicated and was causing bugs as I introduced acceleration and speed.
I was able to greatly simplify when I realized the train track is essentially a number line wrapped into a circle. I can store a car’s location with a single number on this line and then later “unwrap” the location based on where along the track it is.
This made for very clean code that leaves no room for bugs. The location is a single value, not some arbitrary pixel location.
Next: I want to look into making the “chug” sound match frequency with the train’s speed.
Added an accelerate/decelerate effect to the train. It accelerates once every 10 frames. I’ve heard about counting frames from speedrunners and fighting game players, but now I truly know what that means 🙂
I’ll sync sound and make acceleration more incremental tomorrow.
Sidenote: Had some blog presentation improvement ideas today.
Late, tired, let’s do this.
Checking off the tutorial challenges. Got the train moving backwards cleanly. Next, let’s have it rev up and rev down over time.
Took on a challenge from the train tutorial. The train can go backwards (kinda).
Drew the sprites for it, but need to iron it out tomorrow.
I’ll look into automated commits after completing the tutorial.
Did two things today:
Nice logic to loop sounds in Pico. Simple start/stop, although I had to do some digging to understand.
The basis of my improvement was understanding that the train’s direction changes only 4 times. Once at each corner.
The original code was written to check where the train should go at any given point on the track.
I updated the code to check if it is on a corner. If so, update the direction to travel. This greatly simplified the code from checking infinite cases to just checking 4.
Tomorrow: dedicate the majority of my time to automating commits and making these demos playable.
Squeeze in a little post here. Added sound effect and refined sprites. I want to make the sound a little more train-like (chugga-chugga) next.
Got the map laid out and train running! Feels solid.
Tomorrow I iron out details. Some sprites are off-center. Also will add some sound effects (and look into automating deploy of commits).