Commit Graph

26 Commits

Author SHA1 Message Date
Jeremy Rand 815758f3ff Rework the game logic to support one and two player games. 2021-01-20 00:06:32 -05:00
Jeremy Rand 1b7d2e240b Fix a bug where it was possible for the player to collide with an exploding bug and then die. Change explosions so they are drawn using background colours which do not result in player collisions. 2021-01-18 00:18:31 -05:00
Jeremy Rand 384a9ea233 Make more globals per player and index into them with the player number at game time. 2021-01-10 23:17:05 -05:00
Jeremy Rand 1cd4ccea3a Start work on supporting two player games. When the user starts a two player game now, two scores are initialized and the number of lives of the two players are independently tracked. Also, all of the score code has been updated to increment the player one or player two score correct. Still need to implement the logic to save the game state per player and switch between the players on each death. 2021-01-06 23:27:51 -05:00
Jeremy Rand 4700bd9cff Fix a bug where the collision and collisionAddr writes went to the wrong bank, leading to memory corruption and crashes. 2021-01-06 22:21:31 -05:00
Jeremy Rand dbbdd156e3 Fix the bug where the tiles on the RHS may be marked dirty and accumulate garbage if the player dies on the RHS. Add some more debug for the crashing bug I am chasing. It looks like more than 12 segments have been added so I am adding debug to detect when the number of segments exceeds 12. 2020-12-25 23:59:09 -05:00
Jeremy Rand d4d511ee4f Fix the bug where the "can shoot" indicator was sometimes not cleaned up. The real problem was that the mouseAddress was incorrect on the first frame of the next life. It still pointed to where the player died. 2020-12-22 21:25:20 -05:00
Jeremy Rand 32aee75462 Add the segment, spider and extra life sounds. Add some more information about the mysterious crash. 2020-12-18 00:50:01 -05:00
Jeremy Rand 763ce0626e Fix problem on real HW where the player will start the next level shooting if they died while shooting, regardless of the state of the mouse. It now ignores the first poll of the mouse at the start of a level to avoid stale poll information. Add some debug in the code for jumping to the head and body segment draw routines to confirm that the table offsets are sane. I have seen a crash which indicates that sometimes the offset is incorrect. 2020-12-16 12:51:37 -05:00
Jeremy Rand d201f80c3b Move the sound code into a gameSound.s file. This is the first step towards going around the sound toolset for playing sounds. 2020-12-16 12:00:56 -05:00
Jeremy Rand 0136579125 Disassociate sound resources from the generators they are connected with. Use multiple generators to play multiple shot sounds at the same time. It sounds weird but it kind of works. 2020-12-10 21:55:13 -05:00
Jeremy Rand bae931aaa6 Add sounds for shooting, killing bugs, dying and resetting mushrooms after death. The shoot sound isn't great because it doesn't restart when rapid fire is happening but this is a start. 2020-12-10 00:45:48 -05:00
Jeremy Rand 8c40086e03 Add the code to prevent the player from passing through a mushroom. 2020-12-01 23:37:17 -05:00
Jeremy Rand 94c7e3f9e4 Add some infrastructure to block the player from passing through mushrooms. The next step will be to code that algorithm. Also, added a build improvement to better handle assembly errors and pass them in to Xcode. 2020-11-30 00:11:55 -05:00
Jeremy Rand 7264cf907d Clamp mouse movement to a max of 8 pixels per frame. Add some code which will become the "refresh the mushrooms after death" implementation. 2020-11-24 22:59:08 -05:00
Jeremy Rand 868f4a3199 Fix a crash that would happen if the last centipede segment collided with the player. Both level and player code was trying to start the next level and the corrupted things badly. Now, the level code is always responsible for starting the next level. The player code only restarts a level when the player dies and doesn't finish the level. 2020-11-19 23:45:23 -05:00
Jeremy Rand fd40c12d31 Explode a bug when it crashes into the player. When the last segment collides with the player, go onto the next level. 2020-11-18 23:36:01 -05:00
Jeremy Rand 64f96896f7 Add the ability to shoot. Detect shot collisions with mushrooms and shoot the mushrooms. Remove the ability to randomly shoot the mushrooms because that debug is no longer needed. Fix a bug where the number of infield mushrooms was not being updated for mushrooms which were shot until gone. 2020-11-16 23:48:36 -05:00
Jeremy Rand 4e6bad0ae7 Start adding the code for supporting shooting. 2020-11-16 00:14:08 -05:00
Jeremy Rand 2abb57b1a5 Add the code for detecting player collisions, exploding the player, decrementing the number of lives and maybe ending the game. 2020-11-11 23:51:09 -05:00
Jeremy Rand c24b8ad072 Change the spider score colour to be the same as mushroom colours so the player does not detect it as a collision. Add code to display the number of lives and add to the number of lives ever 12,000 points. This lays the groundwork for handling player death and collisions. 2020-11-09 00:12:51 -05:00
Jeremy Rand f58a831eb9 Fix the bugs related to marking dirty tiles for the player. Everything seems to move smoothly now and works well at 2.8MHz. Next, I need to block the player from going over top of mushrooms. 2020-11-05 01:54:12 -05:00
Jeremy Rand edcddc0bd8 This build has the player moving in X and Y directions and with cleaner handling of the dirty tile to remove the inefficiencies. The good news is that there is no longer any performance problem at 2.8 MHz now that the inefficient dirty tile handling has been removed. The bad news is that they player leaves garbage behind indicating some kind of problem with dirty tile marking. But it is close. 2020-11-05 00:21:46 -05:00
Jeremy Rand bb66ef4b03 Replace the C code which built tables at game launch time with a script which generates these tables at build time. This reduces the start time of the application and saves code space and is a necessary step before adding some new tables to handle the mouse efficiently. 2020-11-04 22:48:18 -05:00
Jeremy Rand 7c0dc8ebb1 Replace the call to the Toolbox with a raw read of the mouse from ADB registers to try to minimize the cost of mouse polling in the game loop. 2020-11-01 22:50:10 -05:00
Jeremy Rand 4e500c6f38 Start adding some mouse code and display a player on the bottom row of tiles only for now. No collision detection hooked up and it is terribly inefficient but it seems to work. 2020-10-28 23:46:32 -04:00