-
'else' encounterd without matching 'if' HELP
This is my Code i keep getting the error message 'else' encountered without matching 'if'
function moveLasers() {
if(laserReady&& Key.isDown(Key.SPACE))
laserReady = false;
currentTime = getTimer();
createlaser();
}else{
if(currentTime+laserDelay<=getTimer()){
laserReady=true;
}
}
-
The problem is you have missed the prase follow by if statement.
function moveLasers() {
if(laserReady && Key.isDown(Key.SPACE)) {
laserReady = false;
currentTime = getTimer();
createlaser();
}else{
if(currentTime+laserDelay<=getTimer()){
laserReady=true;
}
}
-
add one more } is what i believe Johnny was trying to say.
-
var x:Number = 1; x /= 0;
no...add one { after the if statement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|