Feature/appearance #6

Merged
ilia merged 9 commits from feature/appearance into main 2026-07-20 07:09:11 +00:00
3 changed files with 7 additions and 1 deletions
Showing only changes of commit 2dc8735fe6 - Show all commits
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

+1 -1
View File
@@ -38,7 +38,7 @@ import { createGameView, managePerkViewsLifetime, rebuildBrickViews, syncronizeV
app.stage.addChild(container); app.stage.addChild(container);
const textures = await Assets.load(['/sprites/fire_ball_1.png']); const textures = await Assets.load(['/sprites/fire_ball_1.png', '/sprites/background_1.png']);
const game = new Game(LEVELS); const game = new Game(LEVELS);
const views = createGameView(game, container, textures); const views = createGameView(game, container, textures);
+6
View File
@@ -1,4 +1,5 @@
import { Container, Graphics, Sprite, Text } from 'pixi.js'; import { Container, Graphics, Sprite, Text } from 'pixi.js';
import { CONTAINER_HEIGHT, CONTAINER_WIDTH } from './config';
import { Ball } from './entities/ball/ball'; import { Ball } from './entities/ball/ball';
import { Brick } from './entities/brick/brick'; import { Brick } from './entities/brick/brick';
import { Paddle } from './entities/paddle/paddle'; import { Paddle } from './entities/paddle/paddle';
@@ -74,6 +75,11 @@ function createPerkView(perk) {
*/ */
export function createGameView(game, container, textures) { export function createGameView(game, container, textures) {
try { try {
const background = new Sprite(textures['/sprites/background_1.png']);
background.width = CONTAINER_WIDTH;
background.height = CONTAINER_HEIGHT;
container.addChildAt(background, 0);
const header = new Text({ style: { fill: '#ffffff', fontSize: 16 } }); const header = new Text({ style: { fill: '#ffffff', fontSize: 16 } });
header.x = 8; header.x = 8;
header.y = 8; header.y = 8;