Commit Graph

229 Commits

Author SHA1 Message Date
Jeremy Rand
1650e8e040 Fix bug where slow head segments would not detect collisions with other segments and change direction. 2020-12-04 00:32:42 -05:00
Jeremy Rand
7368281d58 Fix a long standing bug I have ignored for too long. When adding centipede segments on the left or right, if there was a mushroom right where the segment was arriving, it would try to change direction even though it was still mostly off-screen. This lead to some very strange segment tracks that should never happen. I have added code to ignore blocking mushrooms and not change direction when the segment is partially off-screen. 2020-12-02 23:51:06 -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
ae8dde2d87 Add the ability to use mame as the GS emulator. The mouse works better under mame than GSPlus for this game. For now, I have both options in the launchEmulator script with one of them commented out. It would be good to put this into the base Makefile infrastructure so mame could be selected as the emulator to use. 2020-11-27 02:19:31 -05:00
Jeremy Rand
5258e79176 Add the code to reset the mushrooms after death. 2020-11-24 23:44:50 -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
34d16c9944 Implement the code to compare and update the high score. Add a todo for a high score list with initials. Remove the border colour performance debug. 2020-11-20 00:31:09 -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
7d64340b5d Ignore offscreen collisions 2020-11-17 23:43:28 -05:00
Jeremy Rand
520aaa5a34 Add collision detection for all of the bug types. Remove the debug code for shooting bugs. It is almost a functional game now! 2020-11-17 22:53:30 -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
51b047e58b Add some items to the todo. But this is by no means a complete list. 2020-11-11 23:54:34 -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
6e49c4c483 Add sprites for ship explosions which are different from the other explosions. 2020-11-10 00:07:10 -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
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
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
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
123c3a48ef Add some comments about the spider score threshold yet to be implemented where it is restricted to a smaller and smaller space close to the player. 2020-10-25 23:25:23 -04:00
Jeremy Rand
5a08aefab5 Fix the code for setting the starting flea speed based on the score threshold. 2020-10-25 23:19:31 -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
bb1cd9b7ba Remove the debug code to control the scorpion speed now that the logic is implemented for that. 2020-10-23 00:25:00 -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
6c3b8398a8 Add the code to start a game and iterate through levels. We don't detect the end of a level yet though. 2020-10-19 23:34:08 -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
99c7d98998 Add some comments about the lack of checking of a score "overflow". 2020-10-13 23:28:39 -04:00
Jeremy Rand
a1b4013e1c Hook up the score. Shooting fleas, spiders, scorpions or segments will increase the score. We track the score in two ways. One is just as a 32-bit unsigned integer for doing numeric comparisons on the score (say to the high score list to be implemented in the future) and secondly as a series of numeric digits displayed in a tile. Both are updated. 2020-10-13 23:24:15 -04:00
Jeremy Rand
b85000b4ed Start adding the infrastructure for levels and score. 2020-10-13 00:09:37 -04:00
Jeremy Rand
a7d1db68e2 Add the code to add head segments once the centipede reaches the bottom of the screen. 2020-10-08 23:59:34 -04:00
Jeremy Rand
6969da19b9 Add code to accelerate to fast speed if the last segment. 2020-10-02 14:57:38 -04:00
Jeremy Rand
eb418fb1c4 Add the ability to shoot centipede segments. 2020-10-02 14:50:14 -04:00
Jeremy Rand
74a21db9e0 Change the starting position so we get a collision right away. 2020-09-24 23:19:43 -04:00
Jeremy Rand
766eaf6273 Add the code to detect segment collisions and change direction if a head is colliding with another head or body segment. 2020-09-24 23:17:39 -04:00
Jeremy Rand
a9f62257f9 Reverse the order in which segments are added in memory and add some data for tracking the tiles occupied by segments. This will allow for segment collision detection next. 2020-09-23 23:04:05 -04:00
Jeremy Rand
69efb23800 Some minor optimization to the update code and check for a mushroom in the tile we are moving into and the next tile when we need to decide to change direction. This better reproduces the real game's behaviour. 2020-09-23 22:42:02 -04:00
Jeremy Rand
1dfbe8156a Add support for having both fast and slow centipedes in play at the same time. 2020-09-21 22:57:06 -04:00
Jeremy Rand
c4902f486b Add some global data to have a bit mask of tiles which contain a centipede segment. This will allow the update code to figure out if centipede segments are colliding and if so, change direction. Still need to write some codegen for this global constant data rather than building it at runtime in C. 2020-09-20 22:22:58 -04:00
Jeremy Rand
a9d3b12725 Add code to poison a centipede. 2020-09-13 16:08:32 -04:00
Jeremy Rand
03466f8847 Add code to allow a centipede and all its body segments to scroll in at the top of the screen at slow speed. Need to do the same for fast speed. 2020-09-13 15:18:18 -04:00