Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: PORGFINAL SpaceInvadersFINAL
Diff: SIgame.cpp
- Revision:
- 1:91edc119bf6d
- Parent:
- 0:4564efa43302
--- a/SIgame.cpp Tue Mar 05 20:29:40 2013 +0000
+++ b/SIgame.cpp Thu Mar 07 22:36:07 2013 +0000
@@ -102,7 +102,7 @@
for (i = 0; i < ELASER_CAP; i++)
{ // Find enemy laser in same location as player's laser if so
- if (pylaser->x == elaser[i].x && pylaser->y == elaser[i].y &&
+ if (pylaser->x == elaser[i].x && pylaser->y <= elaser[i].y+2 &&
!(pylaser->collide || elaser[i].collide))
{ // Both lasers cancel each other out and disappear on screen
pylaser->collide = elaser[i].collide = true;
@@ -144,7 +144,8 @@
(wave[r][c].x)++;
// Player loses if any alien reaches screen border at player's side
- if (wave[r][c].y > SCREENHEIGHT - (wave[r][c].height << 1) + 1)
+ if (wave[r][c].y > SCREENHEIGHT - (wave[r][c].height << 1) + 1
+ && !(wave[r][c].killed))
reach = true;
}
}