Fix bug where gem could be marked as collected even if move was undone.
This commit is contained in:
parent
3503aeb00b
commit
502b8262e5
2 changed files with 15 additions and 5 deletions
9
game.scm
9
game.scm
|
@ -196,6 +196,10 @@
|
|||
(define (next-level!)
|
||||
(let ((idx (+ *level-idx* 1)))
|
||||
(pk 'next-level idx)
|
||||
;; TODO: Maybe show a little achievement popup when all gems
|
||||
;; are collected?
|
||||
(when (with-goblins ($ (level-actor *level*) 'gem-collected?))
|
||||
(set! *gems* (cons *level-idx* *gems*)))
|
||||
(set! *level-idx* idx)
|
||||
(if (< idx (vector-length levels))
|
||||
(begin
|
||||
|
@ -272,10 +276,7 @@
|
|||
(('player-death x y)
|
||||
(play-sound-effect audio:die))
|
||||
(('pickup x y)
|
||||
(play-sound-effect audio:pickup)
|
||||
;; TODO: Maybe show a little achievement popup when all gems
|
||||
;; are collected?
|
||||
(set! *gems* (cons *level-idx* *gems*)))
|
||||
(play-sound-effect audio:pickup))
|
||||
(('emit x y)
|
||||
(play-sound-effect audio:emit))
|
||||
(('emitter-on x y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue