Skip to content
Snippets Groups Projects
Commit a903fac7 authored by echicken's avatar echicken
Browse files

New checkBottom() wasn't allowing the chicken to fall into a pit and die. Fixed, kthnx.

Stop updating the life counter before reloading the level. That was just stupid. :|
parent bad514ed
Branches
Tags
No related merge requests found
......@@ -145,8 +145,6 @@ while(!js.terminated) {
if(collision || player.y + player.height > 24 || (timeElapsed > timeLimit)) {
lives = lives - 1;
lifeBox.clear();
lifeBox.putmsg("\1h\1wLives: " + lives);
deathFrame.open();
deathFrame.clear();
deathFrame.crlf();
......@@ -288,13 +286,13 @@ function fall(player, frame) {
function checkBottom(sprite) {
var retVal = false;
sprite.move(0, 1);
if(sprite.y + sprite.height > 24) retVal = true;
for(var p in platforms) {
if(checkOverlap(sprite, platforms[p]) || retVal) {
if(checkOverlap(sprite, platforms[p])) {
retVal = true;
break;
}
}
if(sprite.y + sprite.height > 24 && !retVal) return true;
sprite.move(0, -1);
return retVal;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment