After the last installment, I’ve been dipping back into GamingMonsters’ video tutorials around GBDK and absorbing some of the concepts. I didn’t follow along in code, but instead used it to sort out what was the “done way” of structuring simple game code. See, I’ve done a lot of coding in the past but that’s always been for web frontend/backend (and a little bit of Arduino stuff in C), which is obviously totally different from games.
After watching a few (and learning a neat trick about more performant delays using
wait_vbl_done() instead of
delay()) I considered that the thing I’ll probably have the hardest time getting my head around is having multiple things going on at once. By that I mean sprites animating at different parts of their cycle, possibly at different speeds, while other things on screen need to be doing their own thing. There’s one loop to control it all and – if you stick a delay in somewhere to slow things down well, then everything will get slowed down. I imagine this is second nature to seasoned game programmers and there are some well-known methods to deal with it but, well, I’ll get to that when I do.
OK, so that aside I took a few days off the project to do other things, then came back tonight to try and put some things together just shooting from the top of my head – not necessarily looking anything up – to see what has stuck in the old grey matter so far.
I decided to make a small… thing.
Sprites and backgrounds! Nice. Game Boy Tile Designer and Game Boy Map Builder in action.
I then decided to add some “idling” animation just to start flexing that “keeping track of the little things” muscle.
Then, yes, as you probably guessed I made it jump when you press the “A” button.
But more than that! I wanted to:
- Play a sound when it jumped
- Have some kind of physics to bring it back to the ground
- Have the animation change depending on where it was in the jump
Came out pretty well:
Time Spent: Just over an hour