Skip to content

Commit

Permalink
feat(style): set background color
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Feb 18, 2024
1 parent cd02307 commit 4a35544
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/levels/sinbad.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title": "Sinbad",
"author": "emex",
"difficulty": "easy",
"color": "lightslategray",
"background": "sprites/background/guitar-city.png",
"music": ["sounds/sinbad.webm", "sounds/sinbad.mp3"],
"volume": 1.0,
Expand Down
1 change: 1 addition & 0 deletions src/levels/tranquil-wave.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title": "Tranquil Wave",
"author": "emex",
"difficulty": "hard",
"color": "lightgoldenrodyellow",
"background": "sprites/background/beach.png",
"music": ["sounds/tranquil-wave.webm", "sounds/tranquil-wave.mp3"],
"volume": 0.5,
Expand Down
2 changes: 1 addition & 1 deletion src/scenes/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TARGET_AREA_Y = 540;

scene(Scene.game, (levelId: string) => {
const level = levels[levelId];

document.body.style.backgroundColor = level.color;
const game = add([timer()]);

game.add([
Expand Down
4 changes: 4 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ body {
overflow: hidden;
}

body {
background: lightgrey;
}

canvas {
position: absolute;
top: 50%;
Expand Down

0 comments on commit 4a35544

Please sign in to comment.