aboutsummaryrefslogtreecommitdiff
path: root/turbo.scm
diff options
context:
space:
mode:
Diffstat (limited to 'turbo.scm')
-rw-r--r--turbo.scm196
1 files changed, 123 insertions, 73 deletions
diff --git a/turbo.scm b/turbo.scm
index d86598a..7419a54 100644
--- a/turbo.scm
+++ b/turbo.scm
@@ -93,7 +93,8 @@
(define game-started? #f)
(define game-over? #f)
(define show-credits? #f)
-(define menu-items (list 'new-game 'credits 'quit))
+(define show-help? #f)
+(define menu-items (list 'new-game 'credits 'help 'quit))
(define menu-selection 0)
(define (vehicle-has-spawn-space? vehicle)
@@ -221,9 +222,9 @@
;;;; Chickadee hooks
-(set-source-volume! music 0.5)
+(set-source-volume! music 0.3)
-; (source-play music)
+(source-play music)
(source-play engine-sound)
(define (update interval)
@@ -295,67 +296,110 @@
(draw-sprite (vehicle-sprite player-car) (vehicle-position player-car) #:rotation player-rotation)
(unless game-started?
(let ((window-top (window-height (current-window))))
- (if show-credits?
- (let ((left-margin 60)
- (top-start 125)
- (gap 25))
- (draw-text "TURBO RACER 3000!"
- (vec2 left-margin (- window-top top-start))
- #:font the-font
- #:scale (vec2 4 4)
- #:color red)
- (draw-text "DEVELOPMENT: Gene Pasquet"
- (vec2 left-margin (- window-top (+ top-start gap)))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "DESIGN: Owen Pasquet"
- (vec2 left-margin (- window-top (+ top-start (* 2 gap))))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "PLAY TESTING: Owen Pasquet"
- (vec2 left-margin (- window-top (+ top-start (* 3 gap))))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "MUSIC: Instrumental by Aries Beats"
- (vec2 left-margin (- window-top (+ top-start (* 4 gap))))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "FONTS: Keshikan"
- (vec2 left-margin (- window-top (+ top-start (* 5 gap))))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "SOUND: qubodup"
- (vec2 left-margin (- window-top (+ top-start (* 6 gap))))
- #:font the-font
- #:scale (vec2 2 2))
- (draw-text "BACK"
- (vec2 250 (- window-top 330))
- #:font the-font
- #:scale (vec2 2 2)
- #:color yellow)
- )
- (begin
- ;; Draw the menu
- (draw-text "TURBO RACER 3000!"
- (vec2 60 (- window-top 125))
- #:font the-font
- #:scale (vec2 4 4)
- #:color red)
- (draw-text "NEW GAME"
- (vec2 250 (- window-top 250))
- #:font the-font
- #:scale (vec2 2 2)
- #:color (if (= menu-selection 0) yellow white))
- (draw-text "CREDITS"
- (vec2 250 (- window-top 270))
- #:font the-font
- #:scale (vec2 2 2)
- #:color (if (= menu-selection 1) yellow white))
- (draw-text "QUIT"
- (vec2 250 (- window-top 330))
- #:font the-font
- #:scale (vec2 2 2)
- #:color (if (= menu-selection 2) yellow white))))))
+ (cond
+ (show-credits?
+ (let ((left-margin 60)
+ (top-start 125)
+ (gap 25))
+ (draw-text "TURBO RACER 3000!"
+ (vec2 left-margin (- window-top top-start))
+ #:font the-font
+ #:scale (vec2 4 4)
+ #:color red)
+ (draw-text "DEVELOPMENT: Gene Pasquet"
+ (vec2 left-margin (- window-top (+ top-start gap)))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "DESIGN: Owen Pasquet"
+ (vec2 left-margin (- window-top (+ top-start (* 2 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "PLAY TESTING: Owen Pasquet"
+ (vec2 left-margin (- window-top (+ top-start (* 3 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "MUSIC: Instrumental by Aries Beats"
+ (vec2 left-margin (- window-top (+ top-start (* 4 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "FONTS: Keshikan"
+ (vec2 left-margin (- window-top (+ top-start (* 5 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "SOUND: qubodup"
+ (vec2 left-margin (- window-top (+ top-start (* 6 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "BACK"
+ (vec2 250 (- window-top 330))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color yellow)))
+ (show-help?
+ (let ((left-margin 60)
+ (top-start 125)
+ (gap 25))
+ (draw-text "TURBO RACER 3000!"
+ (vec2 left-margin (- window-top top-start))
+ #:font the-font
+ #:scale (vec2 4 4)
+ #:color red)
+ (draw-text "Complete 10miles fast!"
+ (vec2 left-margin (- window-top (+ top-start gap)))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "Arrow keys or WASD control the car."
+ (vec2 left-margin (- window-top (+ top-start (* 2 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "ESCAPE for the main menu"
+ (vec2 left-margin (- window-top (+ top-start (* 3 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text ""
+ (vec2 left-margin (- window-top (+ top-start (* 4 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text ""
+ (vec2 left-margin (- window-top (+ top-start (* 5 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text ""
+ (vec2 left-margin (- window-top (+ top-start (* 6 gap))))
+ #:font the-font
+ #:scale (vec2 2 2))
+ (draw-text "BACK"
+ (vec2 250 (- window-top 330))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color yellow)))
+ (else
+ ;; Draw the menu
+ (draw-text "TURBO RACER 3000!"
+ (vec2 60 (- window-top 125))
+ #:font the-font
+ #:scale (vec2 4 4)
+ #:color red)
+ (draw-text "NEW GAME"
+ (vec2 250 (- window-top 250))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color (if (= menu-selection 0) yellow white))
+ (draw-text "CREDITS"
+ (vec2 250 (- window-top 270))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color (if (= menu-selection 1) yellow white))
+ (draw-text "HELP"
+ (vec2 250 (- window-top 290))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color (if (= menu-selection 2) yellow white))
+ (draw-text "QUIT"
+ (vec2 250 (- window-top 350))
+ #:font the-font
+ #:scale (vec2 2 2)
+ #:color (if (= menu-selection 3) yellow white))))))
(draw-sprite dash-7seg-background (vec2 270 0))
@@ -436,15 +480,21 @@
((and (eq? key 'return) game-over?)
(reset-game!))
((and (eq? key 'return) (not game-started?))
- (if show-credits?
- (set! show-credits? #f)
- (cond
- ((= menu-selection 0)
- (reset-game!))
- ((= menu-selection 1)
- (set! show-credits? #t))
- ((= menu-selection 2)
- (abort-game)))))))
+ (cond
+ (show-credits?
+ (set! show-credits? #f))
+ (show-help?
+ (set! show-help? #f))
+ (else
+ (cond
+ ((= menu-selection 0)
+ (reset-game!))
+ ((= menu-selection 1)
+ (set! show-credits? #t))
+ ((= menu-selection 2)
+ (set! show-help? #t))
+ ((= menu-selection 3)
+ (abort-game))))))))
(define (key-release key modifiers)
(cond