Add function to move to a new level
This commit is contained in:
parent
d56e5a3d1a
commit
b4d5bff3fc
2 changed files with 14 additions and 1 deletions
|
@ -136,6 +136,10 @@ Level = function(levelName) {
|
|||
|
||||
if (wipe.x < 600) {
|
||||
wipe.x += 15;
|
||||
|
||||
if (wipe.x > -30 && wipe.newlevel) {
|
||||
Memory.loadStage();
|
||||
}
|
||||
}
|
||||
|
||||
if (level.map.save && !level.saved && dolphin.position.z < -30 && dolphin.momentum.y > 0) {
|
||||
|
@ -151,6 +155,11 @@ Level = function(levelName) {
|
|||
}
|
||||
}
|
||||
|
||||
level.moveLevels = function() {
|
||||
wipe.x = -630;
|
||||
wipe.newlevel = true;
|
||||
}
|
||||
|
||||
function cameraThinker() {
|
||||
// Camera thinker.
|
||||
var targetX, targetY;
|
||||
|
|
|
@ -64,9 +64,13 @@ Memory = (function() {
|
|||
}
|
||||
|
||||
if (gotomap) {
|
||||
Game.setScene(Level(data.lastStage));
|
||||
Memory.loadStage();
|
||||
}
|
||||
}
|
||||
|
||||
Memory.loadStage = function() {
|
||||
Game.setScene(Level(data.lastStage));
|
||||
}
|
||||
|
||||
return Memory;
|
||||
})();
|
Loading…
Add table
Reference in a new issue