Sunday, 28 February 2010

Granny gets some real action now.

28th February 2010

Today I have been working on the tweaking of the IRQ routine. Seems that I was using one that runs on the BASIC kernal, so I decided to switch that off and use the standard non-Kernal interrupt vectors $FFFE & $FFFF and also switch to NMI Lock using $FFFA & $FFFB. Works fine, now what I want to do is get those enemies stopping at a certain Y position, then move an X position, then walk the rest of the way downwards off screen. To get this working, I need to create some loops and some data tables. I will also need to create some triggers to make the characters stop moving Y if they are moving X. Also depending on which X direction each character should move, I should create a table with switches to show whether the characters have to go left or right. In theory this method should hopefully work.

I tested the movement for the first character with the random stopping position movements for just one character and it worked a dream. Next I implemented the same routine to all of the characters (except for the store assistant) to get them moving. This wasn't working properly at first, but after a few tweaks or rewriting of the code, I got all the characters moving through a random basis, to make game play slightly more interesting.

Now was the time to work on the sprite to sprite collision. I used the same collision method as usual as it makes programming much easier for me. I know I have used this collision routine time and time again, but it is something that could be remembered really well, without having to do so much research. I created separate routines corresponding to each character and linked all of the collision routines to the player's fire button press routine. Unfortunately there seems to be a silly error in the code, in which all but one character stops if Granny hits that character with her cane. I found where the problem lies. It seems that I RTS the movement command which causes all enemies to stop. So I made some multiple JMP to next routine commands to make things work correctly. Well, it seems to work now. I also got the coin routines to work nicely as well.

After all the collision routines worked correctly, I worked on some sub routines that will show the death animation sequences for the player, and also for the enemies that have been hit as well. Seems to be working fine. Now to add the scoring and lives counter, then I shall call it a day for today and do some other time.

No comments:

Post a Comment