13th March 2021
Yet more activity has been taking place with Cruiser-X 79. Well, what has been going on this time round. For a start off, earlier on this week (Wednesday or Thursday evening I think), I have been working on a few features in the game. The previous week (or two) had alien groups added to the game's code. These are not yet set according to level, but this will happen next week. This week was all about the player's capabilities, and also the enemies.
First of all, I have pictured a situation, where I always used the player's bullet to morph into an explosion and transform the alien animation into a blank sprite. This has been a typical case scenario for my C64 games. However, if I were to create a power up that activated a smart bomb feature. This method of explosion seriously would not look right one bit. There is a solution to this problem. I create some macro routines and pointers in order to check whether an alien is dead or active. If the alien is dead, morph the current alien animation into an explosion and then transform it into a blank sprite. After setting up the code for this feature, the trick worked.
Now it was time for the player to get its revenge on those aliens that try and take over the galaxy. In the game's background, there are three different tiles, which the player can pick up in order to gain power ups. Those are marked as S, M and B. Earlier on last time, I had created a border change to test that the player was able to collect the power up characters. Now I needed to put the power ups feature to reality.
The first thing to is generate a subroutine which tests the player's shield properties. I have to make an indicator that will test the player whether it is carrying a shield or not. If the shield is carried, it should be activated on the player. This indicator has been made by using a colour flash table, and also a couple of pointers. The first pointer does a shield countdown. I made the counter countdown the same amount of time as I did with another game of mine (200 - 0). It is more or less the same mount of time the player has invincibility inside a SEUCK/Sideways SEUCK game (Note that Cruiser-X is not a SEUCK game). I have also placed a subroutine which checks whether the player is dead or not. This is in order to avoid the player exploding while it is still exploding. A similar routine has been made to check that the player is still carrying a shield. This is so that aliens or deadly background cannot do any harm to the player.
Now the player's shield is out the way. I need to do something about the player's bullet. Saul did a few sprites, where there are 5 different bullet types which the player can shoot. A power up table was required. I setup the table, and made some pointers in which triggers the table read each time a new power up has been picked up. The power ups grow in size, and the player can shoot faster.
Next there is one more feature I need to create on the power ups side of things. That is of course the smart bomb feature. The player can pick up the smart bomb feature, but something needs to be done to activate it. I programmed a smart little indication feature by re-designing the HUD's layout. Then I created some subroutines that check for the number of bombs the player can carry. There are 3 bomb icons on the right of the panel, when lit in blue - this indicated no bomb available. However when lit in yellow, this means the bomb is active.
How do I get to use the smart bomb feature in the game? Well, first of all, the player's auto-fire had to be removed. For some strange reason I could not read the space bar key by checking the value of $DC01 as #$EF no more. There must have been something in the code blocking it. Instead, I had a brain wave. Since the success of my smart bomb feature in Border Blast 3, I thought that I should give it a blast with this game. I created a hold fire pointer, and made it count up to 16. If the counter times out, the smart bomb gets activated, but how does that happen?. I cheated a little with this method by automatically making all of the enemies pointers to reset the animation to 0 for explosion and trigger the enemy is dead function.
That's the power ups. What next? Well, the player can shoot and blow aliens up with one shot. What about the aliens? They can move about, but for some reason, they cannot attempt to blast the player?. Well, I think it would be fair if they can be trigger happy as well as the player. I create a few subroutines that trigger the enemies to fire and select the enemy to fire the bullets. Unfortunately there are a few problems. The bullet just keeps on firing from the same alien and sometimes the bullet appears before the aliens enter the screen. A solution to this problem. I set boundaries where the bullets cannot be fired. However the same aliens are still firing until out of the screen. How do I solve this? Easy, a random alien select table, and death check routine. If the alien is dead, it should not shoot, and also the same alien object should not fire. Other aliens should also. I set a few more check routines, to ensure the aliens are alive and shoot. The trick worked. No there are no problems with the alien firing.
I'm nearly done for this week on this project, but before I do, there is just one more feature I would like to add into the game, before I update the GitHub with the newer source. I want to make the background flash. Also sort out the player level complete sequence. The player should fly to the middle and move upwards out of the screen, and "Well Done" should pop on to the screen. Also the smart bomb feature should flash. I added a flash table, and linked it to the raster split that triggers the game's background colour. I linked it with the smart bomb count down timer and the feature worked.
Progress is shaping up quite nicely. I'm pleased with the result so far. Next week, I will be working on the level setup code and select the aliens and background colour schemes for those particular levels.
No comments:
Post a Comment