I have created….. Shape Invaders! (I can’t draw.)
jQuery makes the JS a bit quicker to write even if it is in a form that I’m not used to. I’ve spent the this night, and with the majority being worked on last night, finishing up the project. I have paged through many API listings, migration notes, and tutorials to get this thing working. And it does! I initially wanted to make a Missile Command clone, but as I neared half way through setting up the playground, drawing backgrounds and actors, and getting individual parts moving, I decided that wasn’t a good idea. I couldn’t think of a way to draw a line from the player which I had rotating to aim towards the falling enemy. So, I made the player crawl around the floor to fire upwards at the falling enemies of red hexagons and green pentagons.
The enemies fall starting at random x intervals from the top of the playground. They are randomly produced in a couple of ways: 1) there’s a randomized chance that an enemy will fall, and 2) if one does fall, there’s a randomized chance of which type of enemy falls with 80% being the red hexagons and 20% being the green pentagons. I’ve installed intervals where the enemies will increase speed by a set amount. The red hexagons will increase speed every 500 points that the player makes by 0.5 pixels. The green pentagons will increase speed every 1000 points by 1. The red hexagons start with a speed of 5 whereas the green pentagons start at 10. This will make the game increasingly difficult, especially as the game progresses.
I couldn’t think of a way to remove the missile after it collides with the enemy after I discovered that, when the missile collides with the enemy, the enemy was removed instead. Which was a happy accident since I wanted to remove that anyway.