Monday, 3 August 2009

Up in the Air - Come Fly With Me

Sunday 2nd August 2009

Well it has been yet another busy afternoon, and still a lot of work is to be done before I can get a fully working level. Last week I was working on preparing the labels for the enemy parameters. Well, today I have done some programming, using parameters and it took a long time to prepare and program, but it was worth the Sunday afternoon for 3 or 4 hours or so.

First of all, I created the data tables (!byte tables) to represent the behaviour of enemy's movement. The movement tables will later on be put inside a timed loop, so that we can vary the enemy's directional movements. Each table will consist with only '0' and '1'. '0' represents the selected direction the enemy moves is switched off, and the '1' represents the selected direction the enemy moves is switched on. For example if I wanted one enemy to move to the left, directions UP, DOWN and RIGHT will be switched off and LEFT will be switched on. Or if I wanted an enemy sprite to move upwards and left, UP and LEFT will be switched on and DOWN and RIGHT will be switched off.



However, I wanted to get this routine working in a correct possible manner, and it took lines of code to program. I had to make an enemy direction store value, so that the directional table that is switched on will make the active enemy sprite move a specified direction. I had to create a LOT of routines to get this to work properly. Mainly comparing the value of the stored direction. If the stored direction label equals 1, the enemy can move that direction. Otherwise the enemy cannot move the specified direction. To make sure the enemy could or could not move, I tested each enemy by setting the first value of the 60 bytes for each table (according to the direction I wanted the enemies to move) and then I assembled and test the movement. Fantastic, it worked. Okay, so it is not ready yet, but it was a good start for enemy movements. My next task will be to vary the movements of the enemies, and then get the floating balloons animated.

No comments:

Post a Comment