Commit Graph

229 Commits

Author SHA1 Message Date
Jeremy Rand
f99ff8e816 Add all the code to handle double speed centipede segments. 2020-09-13 14:54:18 -04:00
Jeremy Rand
dc5ab4720d Fix bugs that cause the centipede segment to drop as if poisoned when it reaches the bottom half of the screen. 2020-09-13 13:32:25 -04:00
Jeremy Rand
ab5f5c6299 Fix bug in code that looks for the edge of the screen which was comparing by tile number, not tile offset. 2020-09-11 00:25:41 -04:00
Jeremy Rand
46567659e9 Add the code to animate the segments at slow speed. There is a bug where the centipede seems to get stuck along the left edge sometimes. But overall looks pretty good. 2020-09-11 00:01:30 -04:00
Jeremy Rand
0362b53e2c The head segment is now animating to the right. But it needs better support for segment speed and it needs to change direction when it reaches an obstacle. And all of the other directions to write still. 2020-09-09 23:53:51 -04:00
Jeremy Rand
0d4677c397 More work towards the animation of centipede segments. 2020-09-08 23:54:44 -04:00
Jeremy Rand
36617cbf9d Lay some more groundwork for animating centipede segments. We now have an array of 96 (97 actually) entries which describe the position of the segment now or in the past. By keeping past information, body segments which follow head segments will take no calculation to update. We just have to animate head segments and body segments will follow them 8 pixels behind automatically. 2020-09-07 22:35:32 -04:00
Jeremy Rand
3b541f8482 Fix bug leading to crash when trying to add centipede body segments. I needed to have a nop instruction after the self-modifying long jump. I am writing 4 bytes of the address into the long jump which only uses a 3 byte address and I was corrupting the next instruction. Inserting a nop ensures no corruption happens. 2020-09-06 13:39:00 -04:00
Jeremy Rand
f5d1aa9ee6 Improve the performance of the centipede segment draw function. 2020-09-06 02:05:33 -04:00
Jeremy Rand
07f8df4b4f Draw the scorpion once we are sure the beam has past it on the screen for the previous frame. Adjust the wait for VBL look to look for less than scan line 200 rather than scan line 0. That way, we shouldn't get a frame glitch at 2.8MHz any more. 2020-09-06 01:54:47 -04:00
Jeremy Rand
92c02ded0f Simplify the handling of the dirty tiles to just store the dirty word and not keep the array of dirty tile offsets. Have the flea use game and non-game dirty tiles to fix the problem with LHS tiles being marked dirty all the time. 2020-09-04 01:55:38 -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
df56cdecf1 Add the ability to display head segments of the centipede. Body segments is not working yet. 2020-08-27 23:36:16 -04:00
Jeremy Rand
3a63b2ef1b Add code to support marking dirty tiles under head and body segments. 2020-08-27 22:36:04 -04:00
Jeremy Rand
d8e9c6863b Add the code to draw the body and head segments in the game loop. Still need to add code to create, update and shoot segments. 2020-08-26 23:44:41 -04:00
Jeremy Rand
67e2b56dc2 Add some more code to support adding bug segments to the game. 2020-08-10 23:58:49 -04:00
Jeremy Rand
7d7afc908d Use macros to reduce the copy/pasted code for marking tiles as dirty. Rough out the support for body and head segments. 2020-07-30 23:34:48 -04:00
Jeremy Rand
2b45813cbb Increase the chance that a flea produces a mushroom. 2020-07-28 15:44:55 -04:00
Jeremy Rand
8bcd4fccf6 Add the code to support switching between fast and slow spiders. 2020-07-27 23:30:11 -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
36be001229 Improve the randN function. Show a different colour on the border when drawing versus updating the game state. 2020-07-27 21:47:28 -04:00
Jeremy Rand
9fde825430 Add some constants for the spider score amounts. 2020-07-27 14:25:22 -04:00
Jeremy Rand
3ad311dca6 Add support for shooting the spider and displaying a score. 2020-07-27 14:22:34 -04:00
Jeremy Rand
49baa1b360 Get spider motion working in both directions. 2020-07-26 16:00:46 -04:00
Jeremy Rand
d4fbd9f14c Almost done animating the spider. 2020-07-26 02:13:06 -04:00
Jeremy Rand
bf01c47285 Getting close to having the spider fully implemented... 2020-07-26 00:05:32 -04:00
Jeremy Rand
18d0c3a80f Add some randomness when the spider changes direction. 2020-07-25 14:54:35 -04:00
Jeremy Rand
213686ea1d The spider can now go down and to the right. More directions to come. 2020-07-25 14:34:44 -04:00
Jeremy Rand
184461947b Getting closer on the spider 2020-07-25 00:01:42 -04:00
Jeremy Rand
f890200a0d More spider work. 2020-07-24 23:50:01 -04:00
Jeremy Rand
45bc6641e6 Some more work on spider animation. 2020-07-24 23:27:33 -04:00
Jeremy Rand
aa2e5408da Some code for adding a spider on the LHS. 2020-07-24 14:42:03 -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
68ecca75df Add support for fast moving scorpions which appear at later levels. 2020-07-22 02:31:50 -04:00
Jeremy Rand
78f439d248 Add a constant for creating a poisoned mushroom. 2020-07-22 01:47:59 -04:00
Jeremy Rand
b3da2023e4 Get the scorpion moving to the right and to the left and poisoning the mushrooms. Still need to handle exploding the scorpion and double speed scorpions. 2020-07-22 00:06:01 -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
Jeremy Rand
1ccdb1d0b6 Start to get scorpion support into the game. 2020-07-20 23:04:27 -04:00
Jeremy Rand
b813253c83 Add support for shooting fleas. When a flea is shot once, it accelerates its drop to the bottom. On the second shot, it explodes. 2020-07-20 00:05:18 -04:00
Jeremy Rand
8d2fbda733 Not sure why this change didn't go with the previous commit. 2020-07-19 15:16:20 -04:00
Jeremy Rand
88ea840e23 Update the flea sprite as it drops. Add random routines. Thanks to John Brooks for those. Use the random routines to pick a column for the flea to drop from. Also, randomly leave behind a mushroom as it falls. 2020-07-19 15:15:45 -04:00
Jeremy Rand
3fcd2ac8a8 Double the speed of the flea. 2020-07-19 02:19:56 -04:00
Jeremy Rand
063b4ce60c Fix the VBL code. 2020-07-18 23:46:09 -04:00
Jeremy Rand
36104869b8 Add the code to animate a flea down the screen on demand. 2020-07-18 23:41:21 -04:00
Jeremy Rand
0336c692c4 Add some code to support animating fleas in the game. 2020-07-18 22:11:20 -04:00
Jeremy Rand
3c0ac30fcb A bunch of optimizations to reduce the number of instructions to draw tiles. 2020-07-17 02:46:36 -04:00
Jeremy Rand
c79303d1dc Put a tile offset instead of a tile number in the dirty lists to eliminate the ASL operations that were necessary when iterating over the dirty tiles. 2020-07-16 23:37:28 -04:00