Feature/appearance #6
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
+1
-1
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user