Day 7

Added Handling varying movemnet speed of the invaders using Microsoft Excel to graph, and calcuate a formalae,
to scale the speed at which the invaders move based on the number of invaders left. So less invaders, the faster they move.

The following was done between between Day 6 and Day 7. was a 15 minute job, to remove a game over variable as its redundant by checking if the number of lives is equal to 0.
Next had to implement the animation of the invaders, each invader graphic has 2 frames, so we alternate between them, I had wrote this code earlier but the limiting code, didn’t
get around to write the limiting code till now, so it was commented out previously.

The idea is to setup so once you clear the invaders it will reset, so revert the invaders, and increment them down a starting position, for the next level.
This was really easy, seperate out the code in the InitGame which initalises each invaders to alive, and the number of invaders alive in total, rows and columns.
After hte last invader is killed, we check if there are no more invaders left, then run this ResetLevel. Added a varible so each time u call ResetLevel(), it will start the invaders from the next line.
And quite proud got that done before midnight, so about two hours maybe two and a half hours of work. That was implemented so now I have have an actual game which, you can keep playing getting more score until game over.

The next step being the bonus ship, which isn’t that tricky or complicated, so will leave that for next time, then invaders firing/ sheild blocks.

Advertisements