git://git.cassowary.me
/
ld56.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
256d5c5
)
don't allow undo onto new level
author
cassowarii
<cassowarii@users.noreply.github.com>
Sun, 6 Oct 2024 23:31:45 +0000
(16:31 -0700)
committer
cassowarii
<cassowarii@users.noreply.github.com>
Sun, 6 Oct 2024 23:31:45 +0000
(16:31 -0700)
game.js
patch
|
blob
|
history
diff --git
a/game.js
b/game.js
index
4a193d9
..
b693313
100644
(file)
--- a/
game.js
+++ b/
game.js
@@
-515,6
+515,7
@@
function undo() {
}
function reset() {
+ create_undo_point();
game.start_transition(zb.transition.FADE, 300, function() {
load_level();
});
@@
-523,6
+524,8
@@
function reset() {
function advance_level() {
if (!can_continue) return;
+ undo_stack = [];
+
console.log("W:", Math.max(...Object.keys(levels).map(a => parseInt(a, 10) || 0)));
if (level_number + 1 > Math.max(...Object.keys(levels).map(a => parseInt(a, 10) || 0))) {