aboutsummaryrefslogtreecommitdiff
path: root/src/items.s
Commit message (Collapse)AuthorAgeFilesLines
* Fix the high byte for the timer initializationMiquel Sabaté Solà2026-03-181-1/+1
| | | | | | | | | | | | | | | | In my infinite wisdom, in order to compute the high byte of the 16-bit timer I masked away the most significant byte, but then shifted right only for a nibble instead of a full byte. This went mostly unnoticed as the value I'm setting for the timer actually falls below of what a byte can represent and, thus, the high byte was always zero. But this was noticeable when I was testing larger numbers which, unsurprisingly, turned out to be _huge_. Fix this by shifting right a full byte instead of a mere nibble. Fixes: cf3a0c963225 ("Implement falling items") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Expand documentation on items.sMiquel Sabaté Solà2026-03-181-10/+29
| | | | | | | The format of buffers are somewhat stable now, so we can expand the documentation to write down what I've finally settled on. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Use specific variables for cached player's tile coordinatesMiquel Sabaté Solà2026-03-181-6/+13
| | | | | | | | | Before this commit we were using the zp_argX variables, but this can go wrong, and more so considering other functions like background collision checking also use these variables. All in all, since we have plenty of RAM to spare, let's just allocate a new set of bytes just for that. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add missing 'Items::zp_current_tiles' updatesMiquel Sabaté Solà2026-03-181-2/+15
| | | | | | | Collisions are based on this, so we better not forget updating these values. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve the accuracy of the dropping zoneMiquel Sabaté Solà2026-03-161-9/+7
| | | | | | | | | | We were abusing on tile collision for this, and it wasn't exact. Not only that, but if the player was fast enough, sometimes the item wouldn't drop as the accelaration would pass through that zone. Avoid that by simply using regular screen coordinates, which aren't too hard to check in this case. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Wait for items to fall before changing screenMiquel Sabaté Solà2026-03-161-92/+115
| | | | | | | | | | | More specifically, whenever the player dies and we need to reset the screen, wait for items to fall in the same way as we do for explosions to disappear. This also brought with it some other changes like removing sprite reset on screen initialization. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Account for items switching to following the player in mid-airMiquel Sabaté Solà2026-03-151-4/+15
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Update the shuttle as fuel is getting inMiquel Sabaté Solà2026-03-151-9/+79
| | | | | | | | | | Just like in the original, the shuttle turns purple for each fuel tank. That being said, due to the restriction from the NES/Famicom on updating background tile attributes, a "half-filled" strategy is being used here to convey the same idea for a total of 6 fuel tanks to be delivered. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement falling itemsMiquel Sabaté Solà2026-03-131-57/+364
| | | | | | | | | Every now and then an item will fall and, as in the original game, a fuel tank will be delivered whenever needed. There are still some things left out for later changes, like picking up items mid-air, or background effects for the rocket being filled with fuel. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Initial implementation for itemsMiquel Sabaté Solà2026-03-111-0/+583
This now only supports the appearance of shuttle parts and the fact that the player can collect them at a very specific order and drop them so to stack up the final shuttle. This is of course just the skeleton and there's a bunch of TODO's left. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>