Commit Graph

33 Commits

Author SHA1 Message Date
Jeremy Rand 0e1e35c7cb Lots of updates to the readme. Add some bars along the left and the right to delineate the play area. 2021-02-12 17:31:30 -05:00
Jeremy Rand 2a52b21f8a Fix bug where the flea sometimes would appear before the second level actually started. 2021-01-20 22:14:59 -05:00
Jeremy Rand 815758f3ff Rework the game logic to support one and two player games. 2021-01-20 00:06:32 -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 4d6f8d39f1 Change the prompt when the stereo channels are swapped so the user gets some feedback. Display the high score list. Still need to add the code to update the high score list. 2020-12-30 23:10:22 -05:00
Jeremy Rand 9f74cb46b2 Hit the sound GLU registers directly instead of calling the ROM routines for setting DOC registers. 2020-12-23 23:26:52 -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 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 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 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 c45c3503d6 This is the first step to getting rid of the tile.c file and replace it with generated assembly instead. And then I can add the extra data required to handle the player correctly. 2020-11-03 00:11:22 -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 0fa9b45f45 Rework the LHS side of the game screen to have some BuGS branding. Move the number of lives indicator to the left and add a player 1 and player 2 section. 2020-10-27 23:59:06 -04:00
Jeremy Rand 62fcc82790 Add the code to shoot mushrooms and hook up a debug routine to shoot random mushrooms. 2020-10-26 23:26:12 -04:00
Jeremy Rand 0dd8222611 Add the code to handle restricting the spider to lower and lower rows as the score goes up. This is the final bit of game logic necessary for the bugs in the game I think. 2020-10-26 22:32:46 -04:00
Jeremy Rand 96a6b6f51f Implement the code to add the flea at the right time. This includes tracking the score in multiples of 20,000 and adjusting the number of mushrooms required in the infield before a flea will appear. Simplify the other score based thresholds which are based on multiples of 20,000 to use this test. Add debug which allows me to add 20,000 to the score whenever I want so I can test these thresholds more easily. 2020-10-25 23:11:11 -04:00
Jeremy Rand 1d4f783a3e Change the code for centipede speed to skip slow speed segments entirely once the score is more than 40000.
Add segments at the start of the next level in reverse order so the single head segments are added first.  This ensures they do collision detection properly in the updateSegment code.
Fix a bug where a set of 16 tiles were always marked as occupied by a centipede segment because we didn't clear it properly on each updateSegment call.  This fixed a problem with segments changing direction for no apparent reason.
Test for collisions on the two tiles the segment is spanning and change direction if either is occupied.  This should eliminate single segments travelling on top of each other.
Add scorpions randomly during a game once we get to level 4.  They are added with a 1 in 512 chance every 60 seconds so you should see a scorpion about once every 10 seconds or so.
When the score is above 20000, add scorpions at fast speed 3/4 of the time, slow speed the other 1/4 of the time.  Lower scores, the scorpion is always slow.
2020-10-23 00:20:18 -04:00
Jeremy Rand 9a34532d77 Implement the code to add spiders to the game. From my testing, it looks like 2 seconds after a spider leaves the game (either shot or off the screen), another one is added. Also, once the score is about 5000, the spiders added will be fast. The only spider behaviour I know of which is so far not implemented is as the player reaches higher levels, the spider constrains itself closer and closer to the bottom of the screen. 2020-10-22 00:00:16 -04:00
Jeremy Rand 1f26b38784 Fix the order of colours for the different levels. Remove the debug code to add centipedes and change the colour palette. This is gone now because we now have the concept of starting a game and progressing through levels with different kinds of centipedes running at different speeds with different palette colours. 2020-10-20 23:13:46 -04:00
Jeremy Rand 04d2e74f15 Add the data about the different levels from a centipede segment perspective. 2020-10-17 16:36:12 -04:00
Jeremy Rand 22a22d3533 Change the code to race the beam down the screen, redrawing the dirty game rows as it goes. 2020-09-04 00:17:19 -04:00
Jeremy Rand b07221c363 Change from an array of structs to a series of individual arrays for the tile information. This makes it easier to index into the arrays because the tile number * 2 is the offset, rather than tile number * 16. 2020-09-02 00:15:53 -04:00
Jeremy Rand 883d882d0e Provide an API to set the default speed of a flea or a scorpion. This will allow the speed to be changed for different levels in the game. Need to add this API for spiders also. 2020-07-27 22:27:18 -04:00
Jeremy Rand 4f74d630b9 Start coding support for the spider. Also, try to show the performance of the main game loop in the border colour. 2020-07-23 23:41:12 -04:00
Jeremy Rand ada774960b Finish up work on the scorpion, adding support for shooting the scorpion. Some more cleanup of hard coded constants, moving them to globals. 2020-07-22 23:46:04 -04:00
Jeremy Rand 78f439d248 Add a constant for creating a poisoned mushroom. 2020-07-22 01:47:59 -04:00
Jeremy Rand 44cb944f22 More general cleanup and get rid of more magic numbers. 2020-07-21 22:30:05 -04:00
Jeremy Rand c614164c14 Add code to get scorpions animating to the left. Lots of cleanup, adding a global data section that also has important global constants. 2020-07-21 21:47:50 -04:00