Thankyou both for your feedback.
My responses to your comments:
"the marching theme is four descending notes, yours is two and surprisingly musical"
I didn't know about this. I knew that I couldn't have a background music like I do on Tetris due to how the game constantly needs to change how the PSG is configured for noise or notes. Noise and notes over each other sounded terrible so I ended up playing either a note (marching and shooting) or noise (alien death or player death) exclusively.
The two note theme I landed on works like this:
A base note, "alien_note" is calculated like this. alien_note = 24-((max_invaders / 8) * 4);
As the game progresses and more aliens are killed, the base_note is increased so the game feels more intense. The value of the note is used in DJ's `playNoteDelay` function in NABU-LIB. He has an array of notes that define the tone frequencies to be sent to the PSG.
Do you know the marching notes and how they are "supposed" to sound? I am completely tone deaf so I just used basic maths to figure out the increasing scale. I too am happily surprised that you find it musical.
"last invader continues the march rather than run."
As DJ mentioned, I believe this was a side effect of how the original game was coded. I believe that the original developers landed on their timings and that was that. The game naturally sped up as the aliens were deleted from memory. A couple of things to note here that are different in my game.
- I don't delete the dead aliens from memory. I just change their pattern from the pattern of an alive alien to the pattern of a blank 16x8 rectangle of pixels. (2 tiles). The routine that draws the aliens draws these blanks in the right places, which overwrite the previous positions of aliens in that location. I insert a blank tile at the beginning of each row and append another to the end of each row.
This way, I don't have to blank the whole frame before drawing the aliens each time they move.
- I am timing the game on the TMS9918a Vertical Blanking signal. That's 60 FPS. I don't, obviously, draw the aliens every one of those frames, but it is the counter. The player, bombs and bullets are calculated and positioned every frame. They are the only items that are sprites. The aliens are tiles.
- I draw the tiles into a framebuffer in memory and copy the 768 tiles from memory into the video memory during the vertical blank period when it's time to move the aliens. Game speed is set to move them every 8 frames on the first level. This is decreased by 2 framed every subsequent level until min 0. I don't believe the game is playable with aliens moving every frame.
This is why the last aliens don't speed up. For me to speed them up, I will have to artificially do so. In otherwords, I would have to add MORE code to the game to simulate the original experience, not less. I don't think I want to do this.
nice that you have auto fire when holding the button!
This is just how I write games. I read the user input and if user input reports pressed at the time I read it, I act on it. With keyboard controls this can be a bit tricky depending on the keyboard and how it handles repeat keys and that sort of thing. There is a difference between how this works on Mame vs real NABU hardware for example. On a joystick it's much much simpler.
after the first stage and screen was not cleared before going back to the attract screen.
I know. This is intentional. Generally when a game goes from death back to attract screen, we have a couple of choices as game designers to make.
- We can prompt the player to exit so they have a chance to see how things went wrong. They can ponder the foolish choice they made before trying again.
- OR we can just clear the screen and draw the attract screen. The player will never be able to brag about their achievements or anylise the final frame of the game for whatever might have gone wrong for them.
These are not designed to be in an arcade, so I kind of like the idea that the player has a chance to see the event that led to their demise. In games like SNAKE for example, if you make it far enough, you want to be able to take a photo of the screen if you made it to level 8 and had a nice long tail. By not clearing the screen, I create these opportunities.
For invaders, it might not make that much sense, but it's a theme that I have carried across from Snake to Tetris and now Invaders.
mystery / ufo
This is in my list of things still to do. Same with 3 player lives.
Other comments and thoughts
CLOUD CPM D Drive is a pretty cool feature. For me developing these games in Windows Subsystem For Linux and then running them on MAME to test, I have, built into my Makefiles the commands to copy the .COM file over to the Internet Adapter\Store folder where Cloud CP/M just picks them up. But yeah - however you get the game on your 'boo is fine by me.
So what's next. Well - I need to get some UFO goodness and some lives in there. I am still wondering about the score text across the top. That font is the one that Leo shared on his github and I really like it. It renders well on the NTSC composite - although I kind of forgot what that looks like now that I am rocking the Tang Nano 9k doo-hicky.
I would also like to revisit the breaking stages of the shields. This was hacked together using a tool that DJ put on the quiver. I want there to be different tiles for when bombs hit the shields and for when player bullets hit them. I want the damage to look more like little craters being formed in the shields. I did try in an initial go-round to do this programmatically, but the Nabu is a bit too slow for that. We really cant have mini-breaks during the game so the Nabu can figure out which pixels to mask out on a shield. It's much quicker to just update the framebuffer with a different pre-generated tile pattern at that location where the projectile hit.
You will notice the "charming" collision detection on the green aliens. It's definitely quite lenient. At least if you hit you always hit. Its just that if you miss, you sometimes hit too...
DJ, I'm cool with you chucking this up for a wider audience if you think it's good enough. I can always release the UFO later, I still have fun playing it even though I made it and have played it to death while coding it...
Now I don't know that I explicitly have to say this, but I do this for fun. It was never my intention to port and replicate an existing game over to the nabu. THe MSX ports do a much better job of that sort of thing than I do. I just want to write code, and I like writing game code because then other people play those games and say nice things about them. I do this for the endorphin hits. I bet, DJ, it feels good to know that I am using NABU LIB to do this work, and that your library is standing up well.
I have seen a couple of other project on here start to take advantage of NABU-LIB and I think that's great. I hope more people do stuff with it. What you have done is make the Nabu really accessible to developers. This is how a software community is created. Well done and keep supporting your library. I for one appreciate it.
To shamelessly plagiarize a line from DJ, Play like its 1984!!!
D