Status Update: May 5th, 2022
It's been a little under a week since I started the project, and things are progressing great!
I started by porting over my animation system from Witch n' Wiz as well as some basic title drawing routines.
One part that I was a little nervous about with this project is scrolling across multiple nametables. I've never done it in any of my shipped projects, and only briefly experimented with it on a prototype last year, and not very successfully. So I wanted to tackle that early and make sure it was working before I started layering on more parts. Luckily it went very smooth, and I had it up and running quite quickly.
- lotus_scrolling2.gif (2.07 MiB) Viewed 3335 times
- lotus_scrolling5.gif (2.6 MiB) Viewed 3335 times
Part of what tripped me up with scrolling when I was experimenting with it last year, was collision detection. I think I was
way over complicating it last time. This time, I took a very simple approach of doing all calculations in "world space", and only the rendering code worries about nametables and camera offsets. This went great, and I had collisions working in no time!
- lotus_jump_and_collide.gif (2.68 MiB) Viewed 3335 times
A big piece of any action game is the ability to die! So I added death when falling in pits, as well as "kill" tiles like these spikes. With this, I also implemented a title screen, game over screen, and the ability to transition between them all.
You may have noticed in the previous gifs that my character sprites were looping around when the player presses against the edge of the screen. For my final task this week I cleaned up that behavior, as well as ensuring that the player never collides with "random data" outside the play area.
To avoid wrapping sprites on the top and bottom, I simply detect if the meta-sprite is 16 pixels or more
above the top of the screen. Since the resolution is 240 high, that gives me 16 pixels of buffer to go into before the sprite wraps around. That is enough in my case.
For the left and right side of the screen I used the PPU feature to disable the left most column of 8 pixels, and then make sure the player can go into that area, which prevents them from reaching a point where the sprites will wrap.
- lotus_noclip.gif (3.93 MiB) Viewed 3335 times
As I write this I am realizing I don't need to disable the background layer (only the sprite layer) which should look even better!