From a20d05376cb2de636abebd64da3eeb6c7e8c7bac Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 29 Oct 2022 21:40:09 -0400 Subject: Day 1 progress. --- apple-town-fair/assets.scm | 6 ++- apple-town-fair/dialog-box.scm | 47 ++++++++++++++++++++ apple-town-fair/game.scm | 87 ++++++++++++++++++++++++++++++++----- apple-town-fair/menu.scm | 92 ++++++++++++++++++++++++++++++++++++++++ apple-town-fair/place.scm | 28 +++++++++++- apple-town-fair/splash.scm | 6 +-- apple-town-fair/time-display.scm | 21 ++++++--- 7 files changed, 265 insertions(+), 22 deletions(-) create mode 100644 apple-town-fair/dialog-box.scm create mode 100644 apple-town-fair/menu.scm (limited to 'apple-town-fair') diff --git a/apple-town-fair/assets.scm b/apple-town-fair/assets.scm index b2fbecc..8aacf46 100644 --- a/apple-town-fair/assets.scm +++ b/apple-town-fair/assets.scm @@ -17,7 +17,9 @@ #:use-module (catbird asset) #:export (monogram-font chickadee-image - home-background-image)) + dialog-box-image + home-background-image + farm-stand-background-image)) (define (scope-datadir file-name) (let ((prefix (or (getenv "APPLE_TOWN_FAIR_DATADIR") (getcwd)))) @@ -34,4 +36,6 @@ (define-font monogram-font (font-file "monogram_extended.ttf") 12) (define-image chickadee-image (image-file "chickadee.png")) +(define-image dialog-box-image (image-file "dialog-box.png")) (define-image home-background-image (image-file "home.png")) +(define-image farm-stand-background-image (image-file "farm-stand.png")) diff --git a/apple-town-fair/dialog-box.scm b/apple-town-fair/dialog-box.scm new file mode 100644 index 0000000..0731e72 --- /dev/null +++ b/apple-town-fair/dialog-box.scm @@ -0,0 +1,47 @@ +;;; Copyright © 2022 David Thompson +;;; +;;; This program is free software: you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation, either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see +;;; . +(define-module (apple-town-fair dialog-box) + #:use-module (apple-town-fair assets) + #:use-module (apple-town-fair common) + #:use-module (catbird node) + #:use-module (catbird node-2d) + #:use-module (chickadee graphics color) + #:use-module (chickadee math vector) + #:use-module (oop goops) + #:export ()) + +(define-class () + (text #:accessor text #:init-keyword #:text #:init-value "" #:observe? #t)) + +(define-method (on-boot (dialog )) + (attach-to dialog + (make + #:name 'background + #:texture dialog-box-image) + (make