SuperMom Game

Click here to Download the game.

Welcome! Here are the commands you can use to build your very own SuperMom game. Let's have fun!

1. addBackground(colorOrImage)

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");

2. addBackgroundMusic(src, options = {{ loop: true, volume: 0.5 }})

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 }});

3. addPaddle1()

What it does: Adds the first paddle (player's paddle) to the game.

addPaddle1();

4. addPaddle2()

What it does: Adds the second paddle (computer's paddle) to the game.

addPaddle2();

5. addBall({{ color = "white", speedX = 5, speedY = 2 }})

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 }});

6. updateBallColor(color)

What it does: Changes the ball's color.

updateBallColor("blue");

7. updateBallSpeed(speed)

What it does: Updates the ball's speed.

updateBallSpeed({{ speedX: 10, speedY: 5 }});

8. addName(name = "Player", x = 20, y = 50)

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);

9. updateName(newName)

What it does: Changes the name displayed in the game.

updateName("David");

10. updateNamePosition(x, y)

What it does: Moves the name to a new position.

updateNamePosition(150, 300);

11. updateNameColor(color)

What it does: Changes the color of the name.

updateNameColor("green");

12. updateNameFontSize(size)

What it does: Changes the size of the name's font.

updateNameFontSize(40);

13. changeName(newName)

What it does: Same as `updateName`. Changes the name.

changeName("Emma");

14. changeNamePosition(x, y)

What it does: Same as `updateNamePosition`. Moves the name to a new position.

changeNamePosition(200, 100);

15. changeNameColor(color)

What it does: Same as `updateNameColor`. Changes the name's color.

changeNameColor("purple");

16. changeNameFontSize(size)

What it does: Same as `updateNameFontSize`. Changes the name's font size.

changeNameFontSize(50);

17. changeBallColor(color)

What it does: Same as `updateBallColor`. Changes the ball's color.

changeBallColor("yellow");

18. changeBallSpeed(speed)

What it does: Same as `updateBallSpeed`. Changes the ball's speed.

changeBallSpeed({{ speedX: 12, speedY: 6 }});

19. addScore()

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! 🎮