Welcome! Here are the commands you can use to build your very own SuperMom game. Let's have fun!
What it does: Adds a background to your game. It can be a solid color or an image.
// Add a blue background
addBackground("blue");
// Add a background image
addBackground("background.png");
What it does: Adds music to your game. You can make it loop and adjust the volume.
// Add looping background music
addBackgroundMusic("music.mp3");
// Add music without looping and with lower volume
addBackgroundMusic("music.mp3", {{ loop: false, volume: 0.2 }});
What it does: Adds the first paddle (player's paddle) to the game.
addPaddle1();
What it does: Adds the second paddle (computer's paddle) to the game.
addPaddle2();
What it does: Adds the ball to the game with customizable color and speed.
// Add a white ball with default speed
addBall();
// Add a red ball with custom speed
addBall({{ color: "red", speedX: 8, speedY: 4 }});
What it does: Changes the ball's color.
updateBallColor("blue");
What it does: Updates the ball's speed.
updateBallSpeed({{ speedX: 10, speedY: 5 }});
What it does: Adds a name to the game. You can set the position too.
// Add the name "John"
addName("John");
// Add the name "Alice" at a custom position
addName("Alice", 100, 200);
What it does: Changes the name displayed in the game.
updateName("David");
What it does: Moves the name to a new position.
updateNamePosition(150, 300);
What it does: Changes the color of the name.
updateNameColor("green");
What it does: Changes the size of the name's font.
updateNameFontSize(40);
What it does: Same as `updateName`. Changes the name.
changeName("Emma");
What it does: Same as `updateNamePosition`. Moves the name to a new position.
changeNamePosition(200, 100);
What it does: Same as `updateNameColor`. Changes the name's color.
changeNameColor("purple");
What it does: Same as `updateNameFontSize`. Changes the name's font size.
changeNameFontSize(50);
What it does: Same as `updateBallColor`. Changes the ball's color.
changeBallColor("yellow");
What it does: Same as `updateBallSpeed`. Changes the ball's speed.
changeBallSpeed({{ speedX: 12, speedY: 6 }});
What it does: Adds a scoreboard to the game to show scores.
addScore();
Use these commands to build and customize your game. Have fun creating! 🎮