03.09.07
Asteroids (they explode and everything now!)
That’s right.
Since my last 102 update, my large asteroids now reappear on the opposite sides of the stage whenever they go 50 pixels beyond the boundaries (so you get nice smooth entrances and exits instead of having them just randomly vanish) and they also create two smaller asteroids when hit. This was a bit of bother as at first I wasn’t able to get an array for the smaller asteroids working properly for some reason. Adding them to the existing large asteroid array (as it recommends in the brief, actually) worked but it meant that everytime you shoot a small asteroid, two more appear, which just leads to anarchy. So I went back to the seperate array for them, and I’m not sure what I did differently this time, but it works and I got them to remove themselves when hit, so that’s great.
Today, I also managed to get them exploding too, before removal, which makes quite an aesthetic difference actually. Originally I tried getting the actual bullets to explode on contact, but the large circles they created instantly removed the small asteroids that were created. Making a whole new movieclip just for an explosion didn’t seem to work either, so I scrapped that and just got the two different asteroid sizes to explode, by creating the animations in their respective movie clips, and inserting a label, which is triggered in the bullet actionscript file when it comes into contact with them. I also created a score variable and you get 10 points for the larger ones and 20 for the small ones, as they’re harder to hit. Maybe it makes more sense the other way around though, I don’t know.
I thought that if you complete the game, you’re always going to get the same, maximum score though, so I thought at some point I’d add a timer to the mix which counts the number of seconds your game lasts. At the end, the fewer seconds you took, the bigger bonus score you get, so it should make for a more interesting scoreboard. Next though, I need to get the collision with the ship sorted so lives get knocked down when you hit the asteroids. I also want to make a health system so that it takes two small asteroids to lose a life, not just one. And, because the asteroid positions are all randomly generated, you could theoretically lose a life right at the start of the game if one happens to be put in the middle, so I need a temporary invincibility feature for the start of the game and after you’ve been hit, so that you’re protected for a second or two.
To me this is almost definately the best project yet, and I really think this is the kind of thing I would particularly like to do for a job. I think I might even adapt my own game out of this as a personal project afterwards, and create a scrolling environment beyond the size of the stage. Fortunately, ActionScript has just suddenly clicked for me, and things are actually working properly without too much stress, so I definately want to keep going and try new things with it.