UI: Rework constants for arcade-style layout and color palette
- Named color constants (arcade blue walls, golden coins, pink doors) - Header bar layout with PAC-MAN title, score label, key indicator - Sidebar time display with label and large value - Game over and pause overlay positions - Smaller round-looking coins (coin-size + coin-inset) - Removed old magic position values Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
;; Coin rendering
|
;; Coin rendering
|
||||||
coin-inset
|
coin-inset
|
||||||
|
coin-size
|
||||||
|
|
||||||
;; Sprites
|
;; Sprites
|
||||||
sprite-scale-pacman
|
sprite-scale-pacman
|
||||||
@@ -56,19 +57,45 @@
|
|||||||
rotation-up
|
rotation-up
|
||||||
rotation-down
|
rotation-down
|
||||||
|
|
||||||
;; UI positions
|
;; Colors
|
||||||
score-text-size
|
color-background
|
||||||
score-text-x
|
color-wall
|
||||||
score-text-y
|
color-door
|
||||||
time-text-size
|
color-coin
|
||||||
|
color-text
|
||||||
|
color-title
|
||||||
|
color-header-bg
|
||||||
|
color-game-over
|
||||||
|
color-pause-bg
|
||||||
|
color-pause-text
|
||||||
|
|
||||||
|
;; UI layout
|
||||||
|
header-height
|
||||||
|
header-title-size
|
||||||
|
header-title-x
|
||||||
|
header-title-y
|
||||||
|
score-label-size
|
||||||
|
score-label-x
|
||||||
|
score-label-y
|
||||||
|
score-value-size
|
||||||
|
score-value-x
|
||||||
|
score-value-y
|
||||||
|
key-ui-x
|
||||||
|
key-ui-y
|
||||||
|
sidebar-x
|
||||||
|
sidebar-width
|
||||||
|
time-label-size
|
||||||
time-label-x
|
time-label-x
|
||||||
time-label-y
|
time-label-y
|
||||||
|
time-value-size
|
||||||
time-value-x
|
time-value-x
|
||||||
time-value-y
|
time-value-y
|
||||||
separator-x
|
game-over-text-size
|
||||||
separator-width
|
game-over-text-x
|
||||||
key-ui-x
|
game-over-text-y
|
||||||
key-ui-y)
|
pause-text-size
|
||||||
|
pause-text-x
|
||||||
|
pause-text-y)
|
||||||
|
|
||||||
(begin
|
(begin
|
||||||
|
|
||||||
@@ -88,8 +115,9 @@
|
|||||||
(define cell-type-key 3)
|
(define cell-type-key 3)
|
||||||
(define cell-type-door 4)
|
(define cell-type-door 4)
|
||||||
|
|
||||||
;; Coin rendering: inset in pixels from cell edge
|
;; Coin rendering
|
||||||
(define coin-inset 7)
|
(define coin-inset 9)
|
||||||
|
(define coin-size 6)
|
||||||
|
|
||||||
;; Sprite scale factors
|
;; Sprite scale factors
|
||||||
(define sprite-scale-pacman 1.5)
|
(define sprite-scale-pacman 1.5)
|
||||||
@@ -119,22 +147,54 @@
|
|||||||
(define rotation-up 90)
|
(define rotation-up 90)
|
||||||
(define rotation-down -90)
|
(define rotation-down -90)
|
||||||
|
|
||||||
;; UI positions for score display
|
;; Colors — arcade-style palette
|
||||||
(define score-text-size 40)
|
(define color-background "black")
|
||||||
(define score-text-x 560)
|
(define color-wall "#2121DE")
|
||||||
(define score-text-y 20)
|
(define color-door "#FFB8FF")
|
||||||
|
(define color-coin "#FFB851")
|
||||||
|
(define color-text "white")
|
||||||
|
(define color-title "#FFFF00")
|
||||||
|
(define color-header-bg "#111111")
|
||||||
|
(define color-game-over "#FF0000")
|
||||||
|
(define color-pause-bg "black")
|
||||||
|
(define color-pause-text "#FF0000")
|
||||||
|
|
||||||
;; UI positions for time display (right side of separator)
|
;; UI layout — header bar at the top
|
||||||
(define time-text-size 35)
|
(define header-height 90)
|
||||||
(define time-label-x 710)
|
(define header-title-size 36)
|
||||||
(define time-label-y 300)
|
(define header-title-x 250)
|
||||||
(define time-value-x 800)
|
(define header-title-y 25)
|
||||||
(define time-value-y 400)
|
|
||||||
|
|
||||||
;; Separator line between play field and UI
|
;; Score display (left side of header)
|
||||||
(define separator-x 670)
|
(define score-label-size 20)
|
||||||
(define separator-width 24)
|
(define score-label-x 20)
|
||||||
|
(define score-label-y 25)
|
||||||
|
(define score-value-size 32)
|
||||||
|
(define score-value-x 20)
|
||||||
|
(define score-value-y 50)
|
||||||
|
|
||||||
;; Key UI position (next to score)
|
;; Key UI indicator position
|
||||||
(define key-ui-x 20)
|
(define key-ui-x 600)
|
||||||
(define key-ui-y 35)))
|
(define key-ui-y 30)
|
||||||
|
|
||||||
|
;; Sidebar (right of maze)
|
||||||
|
(define sidebar-x 672)
|
||||||
|
(define sidebar-width 4)
|
||||||
|
|
||||||
|
;; Time display (right sidebar area)
|
||||||
|
(define time-label-size 20)
|
||||||
|
(define time-label-x 700)
|
||||||
|
(define time-label-y 200)
|
||||||
|
(define time-value-size 40)
|
||||||
|
(define time-value-x 710)
|
||||||
|
(define time-value-y 240)
|
||||||
|
|
||||||
|
;; Game over overlay
|
||||||
|
(define game-over-text-size 48)
|
||||||
|
(define game-over-text-x 180)
|
||||||
|
(define game-over-text-y 380)
|
||||||
|
|
||||||
|
;; Pause overlay
|
||||||
|
(define pause-text-size 48)
|
||||||
|
(define pause-text-x 200)
|
||||||
|
(define pause-text-y 400)))
|
||||||
|
|||||||
Reference in New Issue
Block a user