aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* State game over only when all players are deadMiquel Sabaté Solà2026-03-086-34/+81
| | | | | | | This is a bit contrary to the original game, where each player would get its own "Game over" event. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Show lifes for player 2 if availableMiquel Sabaté Solà2026-03-084-35/+68
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Define the bitmap for multiplayer supportMiquel Sabaté Solà2026-03-085-3/+23
| | | | | | | Also give it a dummy value on start and initialize it properly after the player's selection on the title screen. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Initialize 'zp_pause_toggle' before NMI enablementMiquel Sabaté Solà2026-03-073-3/+16
| | | | | | | | | Otherwise we might randomly get weird scenarios like the title screen not showing up properly. Fixes: bc99212539f6 ("Toggle a "Paused" message on top of the screen") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Move some variables into another memory regionMiquel Sabaté Solà2026-03-072-10/+10
| | | | | | | | The zp_player_tile_* variables fit perfectly with the space that is left in the $0x memory region. This allows for a more contiguous space (e.g. on $Cx) for other elements to come (e.g. items). Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Switch the palette for bullets into something more colorfulMiquel Sabaté Solà2026-03-071-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Make bullet transitions in relation to HZMiquel Sabaté Solà2026-03-071-6/+6
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Ramp up the revive counter for enemiesMiquel Sabaté Solà2026-03-071-1/+1
| | | | | | | This way it feels more like a swarm of enemies and you don't have any resting time. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix documentation error on the 'chase' algorithmMiquel Sabaté Solà2026-03-071-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Update the explosions' pool capacityMiquel Sabaté Solà2026-03-072-5/+5
| | | | | | | More enemies means more possible explosions. Hence, increase the pool's capacity by one to match the recent change in enemies per screen. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Bump up to 4 enemies per screenMiquel Sabaté Solà2026-03-062-14/+14
| | | | | | | | This is more similar to the original game, and it's a bit more fun. In order to do so some variables had to move into another memory page, but that's fine as we have plenty. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Make more things operate on SIZEOF_POOL_ITEMMiquel Sabaté Solà2026-03-061-8/+8
| | | | | | | Out of consistency, let's use it, and this way experimenting with the amount of enemies per screen won't be as painful. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Convert enemy vs bullet collision into a loopMiquel Sabaté Solà2026-03-063-24/+26
| | | | | | | | The fact that unrolling the loop was easier or faster was a plain lie from my lazyness. Convert it into a proper loop just so we can experiment with adding more enemies in one screen. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix bounce up for cross enemiesMiquel Sabaté Solà2026-03-062-12/+2
| | | | | | | | | Some old code was checking on the kind of level and skipping the bottom check if it was a half-sized enemy. However, the 'bounce' algorithm is not used by any half-sized enemy. Thus, the check can be removed entirely. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Make bullets thickerMiquel Sabaté Solà2026-03-062-27/+27
| | | | | | | On real hardware I've noticed that individual bullets are barely noticeable. Make them a bit thicker. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Rename scoped variables without being redundantMiquel Sabaté Solà2026-03-064-186/+186
| | | | | | | Some variables had the same name of the scope in their names as well. Remove this redundancy everywhere. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Check for enemy death after its movementMiquel Sabaté Solà2026-03-062-1/+10
| | | | | | | | | Some enemies might die right after moving (e.g. asteroids exploding into the ground). In these cases, there's no point on checking for player collision. Moreover, this also avoids the corner case of having two explosions on a single death. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Toggle a "Paused" message on top of the screenMiquel Sabaté Solà2026-03-065-35/+97
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Don't toggle pause from a holded buttonMiquel Sabaté Solà2026-03-063-2/+13
| | | | | | | | | | | If you just holded the Select or Start buttons, it would be forever toggling pause/unpause, which is an unexpected behavior. Fix this by saving which value from the joypad was previously read. With this, whenever the pause timer reaches zero, we can check whether either button is still pressed, and avoid toggling if that is the case. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Small savings on re-using untouched registersMiquel Sabaté Solà2026-03-061-8/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve documentation on Enemies::zp_current_tilesMiquel Sabaté Solà2026-03-061-10/+17
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add the 'each' and 'release' make targetsMiquel Sabaté Solà2026-03-062-1/+32
| | | | | | | | | | The 'each' target is used to dump all the different combinations into my Everdrive so to test on real hardware. The 'release' target is used so the "DEV" version of the ROM does not make it into the releases page from Github. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix a cycling bug when shooting carelesslyMiquel Sabaté Solà2026-03-062-1/+14
| | | | | | | | | | | | | | | | When shooting like crazy and killing random enemies, after a while a cycling bug would appear which would make enemies to turn in weird directions, die unexpectedly, and other weird shenanigans. This comes back to commit 7c493ba3f338 ("Improve a bit the performance on enemy death"), which removed the saving/restoring of the value on the 'y' register. That being said, this register was actually being needed at least by Bullets::update(), so in certain situations this register might have a bad value (e.g. via the Explosions::create() call). Fixes: 7c493ba3f338 ("Improve a bit the performance on enemy death") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* ci: clean up previous continuous releasesMiquel Sabaté Solà2026-03-051-0/+5
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* ci: overwrite files from releasesMiquel Sabaté Solà2026-03-051-0/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* ci: automatically produce a release fileMiquel Sabaté Solà2026-03-051-1/+18
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Remove the pool size from enemiesMiquel Sabaté Solà2026-03-053-16/+2
| | | | | | It was never read anyways, so let's drop it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Exchange the colors on the second foreground paletteMiquel Sabaté Solà2026-03-051-1/+1
| | | | | | This allows enemies to be even more varied when it comes to the color. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Make enemies more colorfulMiquel Sabaté Solà2026-03-053-12/+43
| | | | | | | Each enemy also has its own palette upon creation. This way we add more variety as it was on the original game. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve a bit the performance on enemy deathMiquel Sabaté Solà2026-03-051-8/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Don't be too tight on the player's feet for collisionMiquel Sabaté Solà2026-03-051-3/+6
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Make randomness a bit more randomMiquel Sabaté Solà2026-03-053-20/+23
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve slightly the look of asteroidsMiquel Sabaté Solà2026-03-052-31/+31
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add the Game Over screenMiquel Sabaté Solà2026-03-057-49/+280
| | | | | | | This is still missing the support for player 2, but I've left traces about it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Update lifes left for player 1Miquel Sabaté Solà2026-03-046-4/+55
| | | | | | | The whole handling of player 2 will come whenever I set to implement multi-player for this game. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add collision with the playerMiquel Sabaté Solà2026-03-047-22/+243
| | | | | | | This allows for explosions to run after making the player to disappear, and it re-runs the entering scene timer. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Let enemies die whenever they touch a bulletMiquel Sabaté Solà2026-03-035-20/+131
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add a pool of explosion effectsMiquel Sabaté Solà2026-03-039-36/+315
| | | | | | | For now this only applies to enemies, but it's general enough so it can target any given coordinate, and hence any given object. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Allow enemies to revive after a given timeMiquel Sabaté Solà2026-03-032-19/+33
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Move enemy initialization into its own functionMiquel Sabaté Solà2026-03-022-4/+17
| | | | | | This will be useful whenever we implement the re-appearance of enemies. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Wrap around the saving of the last allocated bulletMiquel Sabaté Solà2026-03-022-2/+7
| | | | | | | | | | If we don't do this, then it's possible to incur into a buffer overflow as the last allocated index is set to the next (out of buffer) position. Whenever we start over on this function, then it will compare for a good bullet on this position, and if it's not exactly $FF, then it will allocate it without problems. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* debug: Add general debugging counterMiquel Sabaté Solà2026-03-021-0/+3
| | | | | | | | This counter is useful to account for certain numbers in hot spots. This way, and with a memory viewer or a debugger, you can directly tell whenever something is off. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Small optimization on bullet initializationMiquel Sabaté Solà2026-03-022-4/+3
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement de 'chase' algorithmMiquel Sabaté Solà2026-03-022-37/+247
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve some comments in enemies.sMiquel Sabaté Solà2026-03-021-4/+4
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Check for all corners on the 'basic' algorithmMiquel Sabaté Solà2026-03-012-18/+26
| | | | | | | | | | There were still some gaps where the check was failing, and trying to be smart about it was going the "it's too complex for what I need here" route. Hence, just go to the good old dumb algorithm of "check all corners". For now the performance has not dropped, so let's hope that we don't have to re-visit this one. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix bottom collision for fighter jet 1sMiquel Sabaté Solà2026-03-012-3/+10
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Finish up the 'homing' algorithmMiquel Sabaté Solà2026-03-012-16/+22
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Allow the 'basic' algorithm to go up or downMiquel Sabaté Solà2026-03-012-6/+13
| | | | | | This is in preparation to the 'homing' algorithm to re-use this one. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Remove the usage to zp_enemy_arg in most placesMiquel Sabaté Solà2026-02-282-74/+31
| | | | | | | | | | | | | | Everywhere except the 'basic' algorithm don't really need this argument. In the beginning I was using it to define some custom velocities, but in the end tweaking the inner timer on the 'extra' value for all enemies turned out to be more productive. Hence, remove this usage almost everywhere and make the code simpler as a side-effect. The usage on 'basic' is still under revision, just to check if 'homing' really needs to set a special argument whenever the 'homing' attack needs this sort of behavior. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>