feat: make better walls

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
Ameya Shenoy 2025-06-25 00:50:20 +05:30
parent d5332715f7
commit 2f6de6315d

View file

@ -86,22 +86,22 @@ export function World() {
}); });
// Bottom wall (ground) // Bottom wall (ground)
const ground = Bodies.rectangle(width / 2, height - 10, width, 20, { const ground = Bodies.rectangle(width / 2, height + 250, width, 500, {
isStatic: true, isStatic: true,
render: { fillStyle: bgColor }, render: { fillStyle: bgColor },
}); });
// Left wall // Left wall
const leftWall = Bodies.rectangle(-10, height / 2, 20, height + 40, { const leftWall = Bodies.rectangle(-250, height / 2, 500, height + 40, {
isStatic: true, isStatic: true,
render: { fillStyle: bgColor }, render: { fillStyle: bgColor },
}); });
// Right wall // Right wall
const rightWall = Bodies.rectangle( const rightWall = Bodies.rectangle(
width + 10, width + 245,
height / 2, height / 2,
20, 500,
height + 40, height + 40,
{ {
isStatic: true, isStatic: true,
@ -110,7 +110,7 @@ export function World() {
); );
// Top wall // Top wall
const topWall = Bodies.rectangle(width / 2, -10, width, 20, { const topWall = Bodies.rectangle(width / 2, -250, width, 500, {
isStatic: true, isStatic: true,
render: { fillStyle: bgColor }, render: { fillStyle: bgColor },
}); });