Another BuGS Weekly Update

I have written the code to animate the centipede segments at least at slow speed.  Double speed centipede segments are not implemented yet. The code is also there to animate the body segments which follow the head.  I used a ring buffer so whenever I figure out where to put a head segment, which way it should face etc, I keep that around in the ring buffer and body segments just update an index into that buffer and use the stuff already calculated for the head segment.  Should work but ran out of time to test it so you don’t get to see that this week.  This clip is running at 2.8MHz.  There are a couple of odd things.  At one point, a hidden mushroom appears when the centipede segment gets close.  This seems to indicate a bug in the flea code.  I suspect the flea left the mushroom behind but didn’t mark the tile dirty so it didn’t get displayed.  Also, the head segment goes a bit nuts at the end and just cycles up and down in a couple of tile columns.  Not sure what that is.  So, the next step is some bug fixing of what I did this week and maybe try to display some body segments.

Oh and I haven’t coded anything to handle a centipede contacting a poison mushroom so that is to come also.

I withdraw my “hidden mushroom” issue.  There is a flea dropping as the centipede passes.  The flea drops the mushroom so it isn’t a mushroom appearing for no reason.  I have the flea, spider and scorpion running at fast speed so the flea flashes past so fast compared to the centipede that it looked to me at first that the mushroom “just appeared”.

And I found and fixed the bug which makes the centipede drop to the bottom of the screen as though it is poisoned.  The issue was one of comparing “number” versus “offset”.  My check for the LHS or RHS of the screen was looking for a tile number (incrementing by 1) but I had a tile offset (incrementing by 2 to use as a word index into arrays with tile info).  As soon as the centipede got low enough on the screen, every tile was considered to be the edge of the screen and it just dropped straight down thinking it always had to change direction.  Adding the missing *2 in the comparison fixed it.  So, no known bugs left now and on to sleep and more features for next week.

Source Code

Changes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.