mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Wall collision fix.
This commit is contained in:
@@ -97,7 +97,7 @@ function MainLoop(timestamp)
|
||||
);
|
||||
|
||||
if (wallLeft < lastWallLeft) {
|
||||
mrCroc.position.x = lastWallLeft + 1;
|
||||
mrCroc.position.x = lastWallLeft + mrCroc.getWidth() * 0.5 + 1;
|
||||
}
|
||||
} else if (KeyRight.isPressed()) {
|
||||
mrCroc.moveRight(timestamp, delta);
|
||||
@@ -108,7 +108,7 @@ function MainLoop(timestamp)
|
||||
);
|
||||
|
||||
if (wallRight > lastWallRight) {
|
||||
mrCroc.position.x = lastWallRight - 1;
|
||||
mrCroc.position.x = lastWallRight - mrCroc.getWidth() * 0.5 - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,6 @@ function MainLoop(timestamp)
|
||||
mrCroc.getPositionHeadLeft().draw(context);
|
||||
mrCroc.getPositionFootLeft().draw(context);
|
||||
*/
|
||||
|
||||
lastRendered = timestamp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user