Thursday, 22 October 2015

Blast those aliens

22nd October 2015

After yesterday's infestation of aliens. I have been working on more of Vortex Crystals this morning, and later in the afternoon. Well, I am still on my holiday leave until this weekend - so what should you expect? ... Yesterday, I worked on positioning the aliens and getting them to move around. Today is a completely different task.

Since the game allowed the player to shoot bullets, let the aliens walk about and the player move around the game area. I thought I was done with this stage. Not yet ... I received an email from Alf Yngve, indicating that the last WIP preview I showed him had a major restriction with the player's jumping on the very top platform. So I decided to alter the interrupts routine and open the top and bottom borders - but NOT allow any sprites to display at the very bottom or the very top of the border. The trick worked.

Now came the fun part of the game's framework. We have already had the running and jumping phase, so now it is the 'shooting' phase. The player can shoot already, but there was no specific collision set where a bullet hits an alien. A few routines were programmed so that according to each alien, a collision detection routine gets called. The first test was to allow the player to fire the bullet and detect the collision. Simply by flashing the border (inc $d020). After I tested the bullet on each alien, it was time to make an alien explosion.

To make the alien explosion, I could choose two different methods. The longest method is to create a morph alien sprite to explosion animation for each alien sprite. Or the alternative method is to stop the bullet sprite from moving, offset the alien sprite and then morph it into an explosion. I took the second option, as it saved me time - and since there's under 3 months to get the compo entry finished, it probably is a brave move.

After testing the alien explosion routine, to see how well it works. I was very happy with the result, and decided to add lives to each alien. This will give the aliens a certain number of hits from the player's bullet, before they explode. After generating the code, and having a little play around with the source to get things right. The program worked a treat - but there is still one more thing before I close down the project for the day.

The next was to get the aliens to re-spawn after a period of time. This should occur after a few seconds the alien last died. When the timer had reached its position per alien, the alien sprite re-appeared on the platform and it was able to move its usual movement afterwards.

My final task before I closed the project down for the day (and backup my work) was to add a score to the player. I made it that only 100 points are scored for draining an amount of lives for the aliens, and 500 points for destroying one. I am pretty pleased with the result of the game's framework so far, and look forward to finishing it in the near future as well :)

The next task will be to add power ups, which might be some time this weekend.

No comments:

Post a Comment