Skip to content

Commit 4a35544

Browse files
feat(style): set background color
1 parent cd02307 commit 4a35544

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/levels/sinbad.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"title": "Sinbad",
44
"author": "emex",
55
"difficulty": "easy",
6+
"color": "lightslategray",
67
"background": "sprites/background/guitar-city.png",
78
"music": ["sounds/sinbad.webm", "sounds/sinbad.mp3"],
89
"volume": 1.0,

src/levels/tranquil-wave.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"title": "Tranquil Wave",
44
"author": "emex",
55
"difficulty": "hard",
6+
"color": "lightgoldenrodyellow",
67
"background": "sprites/background/beach.png",
78
"music": ["sounds/tranquil-wave.webm", "sounds/tranquil-wave.mp3"],
89
"volume": 0.5,

src/scenes/game.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const TARGET_AREA_Y = 540;
1515

1616
scene(Scene.game, (levelId: string) => {
1717
const level = levels[levelId];
18-
18+
document.body.style.backgroundColor = level.color;
1919
const game = add([timer()]);
2020

2121
game.add([

src/style.css

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ body {
1111
overflow: hidden;
1212
}
1313

14+
body {
15+
background: lightgrey;
16+
}
17+
1418
canvas {
1519
position: absolute;
1620
top: 50%;

0 commit comments

Comments
 (0)