diff options
Diffstat (limited to 'apple-town-fair')
-rw-r--r-- | apple-town-fair/game.scm | 21 | ||||
-rw-r--r-- | apple-town-fair/place.scm | 9 |
2 files changed, 15 insertions, 15 deletions
diff --git a/apple-town-fair/game.scm b/apple-town-fair/game.scm index 5ede549..71ee13a 100644 --- a/apple-town-fair/game.scm +++ b/apple-town-fair/game.scm @@ -490,29 +490,28 @@ August 1675") (define-class <choose-action-mode> (<major-mode>)) (define-method (advance-clock-once (mode <choose-action-mode>)) - (advance-clock (parent mode) 1)) + (advance-clock ($) 1)) (define-method (quit-game (mode <choose-action-mode>)) (exit-catbird)) (define-method (up-selection (mode <choose-action-mode>)) - (up-selection (& (parent mode) menu) 1)) + (up-selection ($ menu) 1)) (define-method (down-selection (mode <choose-action-mode>)) - (down-selection (& (parent mode) menu) 1)) + (down-selection ($ menu) 1)) (define-method (confirm-selection (mode <choose-action-mode>)) - (let* ((scene (parent mode)) - (place (& scene place)) - (chosen (selection (& scene menu))) + (let* ((place ($ place)) + (chosen (selection ($ menu))) (action (find (lambda (a) (string=? (name a) chosen)) (actions place)))) - (run-script scene - (hide (& scene menu)) - (perform action scene) - (hide (& scene dialog)) - (show (& scene menu))))) + (scene-script + (hide ($ menu)) + (perform action) + (hide ($ dialog)) + (show ($ menu))))) (bind-input <choose-action-mode> (key-press 'r) reset-game) (bind-input <choose-action-mode> (key-press 'escape) quit-game) diff --git a/apple-town-fair/place.scm b/apple-town-fair/place.scm index b96130d..01750da 100644 --- a/apple-town-fair/place.scm +++ b/apple-town-fair/place.scm @@ -17,6 +17,7 @@ #:use-module (catbird config) #:use-module (catbird node) #:use-module (catbird node-2d) + #:use-module (catbird scene) #:use-module (oop goops) #:export (<action> condition @@ -34,11 +35,11 @@ #:init-form (const #t)) (exec #:accessor exec #:init-keyword #:exec)) -(define-method (performable? (action <action>) scene) - ((condition action) scene)) +(define-method (performable? (action <action>)) + ((condition action) (current-scene))) -(define-method (perform (action <action>) scene) - ((exec action) scene)) +(define-method (perform (action <action>)) + ((exec action) (current-scene))) (define-class <place> (<node-2d>) (title #:accessor title #:init-keyword #:title #:init-value "Unknown") |