feat: Добавлен базовый ряд блоков

This commit is contained in:
Ilia Mashkov
2026-07-16 12:46:09 +03:00
parent 4627fe4f76
commit d79fb5435b
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -7,3 +7,6 @@ export const PADDLE_HEIGHT = 10;
export const BALL_RADIUS = 10;
export const BALL_SPEED = 3;
export const BALL_INITIAL_ANGLE = 180;
export const BRICK_WIDTH = 40;
export const BRICK_HEIGHT = 10;
+10
View File
@@ -4,6 +4,8 @@ import {
BALL_INITIAL_ANGLE,
BALL_RADIUS,
BALL_SPEED,
BRICK_HEIGHT,
BRICK_WIDTH,
CONTAINER_HEIGHT,
CONTAINER_WIDTH,
PADDLE_HEIGHT,
@@ -42,6 +44,14 @@ import {
}
});
const bricksRow = Array.from({ length: Math.floor(CONTAINER_WIDTH / BRICK_WIDTH) }).map((_, index) => {
const brick = new Graphics().rect(0, 0, BRICK_WIDTH, BRICK_HEIGHT).fill('#000fff');
brick.x = index * BRICK_WIDTH;
brick.y = 1;
container.addChild(brick);
return brick;
});
const ball = new Graphics().circle(0, 0, BALL_RADIUS).fill('#ffffff');
container.addChild(ball);