Commit Graph

236 Commits

Author SHA1 Message Date
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
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
Jeremy Rand
5c188bf91e More work on tiles. A tile now knows the tile number of its neighbours. This will make it easier for a sprite to mark the dirty tiles when drawing. 2020-07-16 23:17:32 -04:00
Jeremy Rand
bff623af89 Add a wait for VBL function. 2020-07-15 23:20:35 -04:00
Jeremy Rand
69e3c4a62a Add some more code for background tiles. 2020-07-15 23:10:25 -04:00
Jeremy Rand
3f9e7bd066 Start implementing the code to draw the tiles on the screen. 2020-07-15 00:32:14 -04:00
Jeremy Rand
63fb8a0e22 Fix a bug in the _collision macro where the mask was not being used. Remove an unnecessary and instruction when drawing heads and body segments. 2020-07-14 01:49:07 -04:00
Jeremy Rand
a718c8caef Lots of general sprite cleanup. Add sprites for the ship and the shots and include collision detection in those routines. I think all of the drawing code is done now, maybe? 2020-07-09 22:55:08 -04:00
Jeremy Rand
bc91429e3a Finish the centipede segment sprites. 2020-07-09 00:27:32 -04:00
Jeremy Rand
9e06ec991b Add a bunch more centipede segment sprites. 2020-07-06 00:01:44 -04:00
Jeremy Rand
5de91ba0ec Add the left body segment sprites. 2020-07-04 02:59:42 -04:00
Jeremy Rand
7f33c3d400 Create all of the left facing head segment sprites. 2020-07-04 02:45:53 -04:00
Jeremy Rand
72265face9 Start adding centipede head segment sprites. 2020-07-03 02:04:27 -04:00
Jeremy Rand
e5378bf5cb Add some info to the sprite design document about my plans for handling clipping. 2020-07-02 23:06:02 -04:00
Jeremy Rand
598934446b Finish the spider sprites and the explosion sprites. Remove "and" masking from the spider and scorpion sprites because they will be drawn first and will not overlap with anything on the foreground. Split the sprite.s file into a series of smaller files for each type of sprite. Add a file to describe the overall plan for the design of the sprites. 2020-07-02 22:57:52 -04:00
Jeremy Rand
e7ca4d4624 More spider sprites. 2020-07-01 13:53:42 -04:00
Jeremy Rand
5371b4e19e Add the first spider sprite. 2020-06-30 23:38:27 -04:00
Jeremy Rand
0393cf6bf6 Finish the sprites for the scorpion. 2020-06-30 23:17:55 -04:00
Jeremy Rand
cc03c8a0a0 Lots of optimization of the sprite code. More scorpions going in the right direction. 2020-06-29 23:45:40 -04:00
Jeremy Rand
3fce9d866a Change the way colour works to make it cheaper to overwrite any background colour with green which will make drawing centipede segments faster. 2020-06-28 22:21:32 -04:00
Jeremy Rand
1b1506aac8 Finish the left facing scorpion sprites. Still need to do the mirror image for right facing. 2020-06-23 23:38:47 -04:00
Jeremy Rand
e34ea58cc1 Add some more sprites for the scorpion. 2020-06-23 01:52:06 -04:00
Jeremy Rand
964da82807 Add some sprites for the scorpion. 2020-06-22 23:45:25 -04:00
Jeremy Rand
936b7315ce Finish the sprites for the flea and the 300, 600 and 900 score notices. 2020-06-18 23:35:20 -04:00
Jeremy Rand
eb480d76d8 Finish sprites for numbers and start work on the flea. 2020-06-18 00:03:41 -04:00
Jeremy Rand
d336ae86ff Finish the sprites for the letters. 2020-06-17 02:16:04 -04:00
Jeremy Rand
fd72e9f18b Start coding up the sprite code. 2020-06-16 23:59:12 -04:00
Jeremy Rand
ceb2d00ff0 Add some code to set the scan line control bytes and the colour palette for all of the different levels of the game. 2020-06-16 00:02:20 -04:00
Jeremy Rand
a9810ecb75 Well, it launches, clears the screen, waits for a key and then quits. But it is a start. 2020-06-10 23:51:53 -04:00
Jeremy Rand
dbe7e7ad3f Initial Commit 2020-06-10 21:47:00 -04:00