|
I have a large amount of errors that are all the same for different methods, but I cannot see for the life of me what is causing the errors.
I know the error is somewhere around here, and I suspect that it has something to do with the array indexing
- In Player.jack (line 37): In subroutine updateBullets: Expected (
- In Player.jack (line 44): In subroutine updateBullets: Expected )
while (i < 50) {
if (~(bullets[i] = null)) {
do bullets[i].update();
// Check for collision or if bullet is off-screen
let hasHitAlienResult = hasHitAlien(bullets[i]);
if (hasHitAlienResult) {
let bullets[i] = null;
} else {
if ((bullets[i].y) < 0) {
let bullets[i] = null;
} else {
let bullets[newSize] = bullets[i];
let newSize = newSize + 1;
}
}
}
let i = i + 1;
}
- In Player.jack (line 63): In subroutine hasHitAlien: Expected (
method boolean hasHitAlien(PlayerBullet bullet) {
return invaders.checkCollision(bullet.x, bullet.y);
}
- In Player.jack (line 103): In subroutine drawLives: Expected statement(do, let, while, return or if)
method void drawLives() {
do Output.moveCursor(1, 25);
do Output.printString("LIVES");
var int i;
let i = 0;
while (i < lives) {
var int location;
let location = 10 * 32 + (300 + i * 30) / 16;
do Memory.poke(16384 + location, 8);
do Memory.poke(16384 + location + 32, 62);
do Memory.poke(16384 + location + 64, 127);
do Memory.poke(16384 + location + 96, 127);
let i = i + 1;
}
return;
}
I basically have these errors for all of my files, but I imagine once I figure out what is causing the problem then I can solve all of them since the solution will most likely apply to all of them.
|