Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
0e8e576
Setting up GitHub Classroom Feedback
github-classroom[bot] Mar 21, 2024
166085e
Update egdd.md
rachel-sison Mar 21, 2024
90dba8a
embeded images
rachel-sison Mar 22, 2024
f73db9d
add level scenes & update readme file
rachel-sison Apr 3, 2024
9be29e4
main menu scene
rachel-sison Apr 4, 2024
b6d450d
level one
rachel-sison Apr 4, 2024
47b85e5
level four
rachel-sison Apr 4, 2024
0b8150e
level one & four
rachel-sison Apr 4, 2024
d4d16ed
package
lizzykal Apr 4, 2024
fbee081
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
lizzykal Apr 4, 2024
de60216
stepping stone image
lizzykal Apr 4, 2024
699b8fe
titles
lizzykal Apr 4, 2024
3dad642
fixing stone image name
lizzykal Apr 8, 2024
66f893e
adding images to preload
lizzykal Apr 8, 2024
5883cbe
fixing title screen
lizzykal Apr 8, 2024
9bc8f46
Merge pull request #12 from UD-S24-CISC374/level-one
lizzykal Apr 8, 2024
cc2fead
duck sliding across title
lizzykal Apr 8, 2024
51acddb
connect main to level one
rachel-sison Apr 8, 2024
f9b15bc
added stones
rachel-sison Apr 8, 2024
0b3c0ba
Merge pull request #13 from UD-S24-CISC374/level-one
rachel-sison Apr 8, 2024
4f86b45
fix errors
rachel-sison Apr 8, 2024
89a3ce3
Merge pull request #14 from UD-S24-CISC374/errors1
rachel-sison Apr 8, 2024
cb74e85
fix 2
rachel-sison Apr 8, 2024
1cbcbb7
Merge pull request #15 from UD-S24-CISC374/errors
rachel-sison Apr 8, 2024
88c770a
add phaser
rachel-sison Apr 8, 2024
0c6cbd7
add lines start level 2
rachel-sison Apr 8, 2024
da5d95e
Merge pull request #16 from UD-S24-CISC374/level-one-lines
rachel-sison Apr 8, 2024
8917d85
transition screens
rachel-sison Apr 8, 2024
ac9b850
made level passed scenes
rachel-sison Apr 8, 2024
6bd9e0f
Merge pull request #17 from UD-S24-CISC374/level2
rachel-sison Apr 8, 2024
f296501
edit
rachel-sison Apr 8, 2024
f40de55
start of level three
lizzykal Apr 8, 2024
5dc7878
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
lizzykal Apr 8, 2024
2d8ce6a
fixing duplicate key
lizzykal Apr 8, 2024
8a220be
level two stones and lines
rachel-sison Apr 8, 2024
37ca188
level two set
rachel-sison Apr 9, 2024
3596e3a
end screen
rachel-sison Apr 9, 2024
7732519
Merge pull request #18 from UD-S24-CISC374/level-two
rachel-sison Apr 9, 2024
b26ee3c
skeleton of level three and four
lizzykal Apr 11, 2024
05a9841
link levels 3 & 4
rachel-sison Apr 11, 2024
c60c43c
Merge pull request #19 from UD-S24-CISC374/fixes
rachel-sison Apr 11, 2024
1c9c8fd
nonfunctioning score and duck movement
lizzykal Apr 11, 2024
b9999ff
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
lizzykal Apr 11, 2024
3734f35
add labels to level 1
rachel-sison Apr 15, 2024
6290d89
add values to level 2, try to implement dijkstras
rachel-sison Apr 15, 2024
71e8935
dijkstras
rachel-sison Apr 15, 2024
19af5fa
Merge pull request #20 from UD-S24-CISC374/labels
rachel-sison Apr 15, 2024
eaf266a
fix?
rachel-sison Apr 16, 2024
1317cc0
Merge pull request #21 from UD-S24-CISC374/fixes2
rachel-sison Apr 16, 2024
a17abe7
duck is mobile
lizzykal Apr 30, 2024
c872149
added numbers to all levels
rachel-sison Apr 30, 2024
8d8e56c
Merge branch 'main' into dijkstra
rachel-sison Apr 30, 2024
2ad97b0
Merge pull request #22 from UD-S24-CISC374/dijkstra
rachel-sison Apr 30, 2024
a493e40
comment
rachel-sison Apr 30, 2024
e90d913
duck moving in level one
lizzykal May 2, 2024
4d3738e
duck movement in level two
lizzykal May 2, 2024
2b75732
duck moving level 4
lizzykal May 2, 2024
63966dc
duck movement level5
lizzykal May 2, 2024
0a02f1a
stone interactive
lizzykal May 2, 2024
d7fe686
add end screen try dijkstras
rachel-sison May 2, 2024
be182b7
Merge branch 'main' into dijkstra1
rachel-sison May 2, 2024
3a4ddfc
Merge pull request #23 from UD-S24-CISC374/dijkstra1
rachel-sison May 2, 2024
1621841
fix
rachel-sison May 2, 2024
9884e3f
add values
rachel-sison May 2, 2024
a36c3ef
levelfour
rachel-sison May 2, 2024
94e07f8
duck/stones interact
lizzykal May 2, 2024
e0fe8a0
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
lizzykal May 2, 2024
80a2914
change values
rachel-sison May 2, 2024
407a693
Merge pull request #24 from UD-S24-CISC374/values
rachel-sison May 2, 2024
84b2c47
fix values
rachel-sison May 2, 2024
2152604
Merge pull request #25 from UD-S24-CISC374/values
rachel-sison May 2, 2024
bdb23e7
fix path values
rachel-sison May 2, 2024
e1bdd6e
fix
rachel-sison May 2, 2024
1c9a461
working path length
rachel-sison May 2, 2024
f9ff3a8
duck/stone interaction
lizzykal May 2, 2024
fbf19e0
path length font
lizzykal May 2, 2024
2f40f85
check answer
rachel-sison May 2, 2024
ebf121f
Merge pull request #26 from UD-S24-CISC374/tryAgain
rachel-sison May 2, 2024
82bf645
fixed
rachel-sison May 2, 2024
4017374
fied2
rachel-sison May 2, 2024
0ff8b92
deleting commented out lines
lizzykal May 2, 2024
39b3e88
accident
rachel-sison May 2, 2024
5f049ca
level3
rachel-sison May 2, 2024
cf35f95
Merge pull request #27 from UD-S24-CISC374/level3
rachel-sison May 2, 2024
5fde291
trying to fix paths
lizzykal May 7, 2024
f4ae9be
small fix
lizzykal May 7, 2024
97031db
addding background muisc/mute button
lizzykal May 7, 2024
5fb0698
adding mute button to each level
lizzykal May 7, 2024
7960443
adding reset button and trying to make tutorial
lizzykal May 7, 2024
6b363a2
level two works!
lizzykal May 7, 2024
c931641
fixing little mistakes
lizzykal May 7, 2024
4c7f8b1
working level 3
rachel-sison May 8, 2024
a6a6ed4
Merge pull request #28 from UD-S24-CISC374/level-three
rachel-sison May 8, 2024
8322fd2
unfinished popup
lizzykal May 10, 2024
602ca44
fixing restart buttons
lizzykal May 13, 2024
3fb5b3e
finish level four
rachel-sison May 13, 2024
6daf920
Merge pull request #29 from UD-S24-CISC374/level-four
rachel-sison May 13, 2024
b518053
fix level 4
rachel-sison May 13, 2024
88f2b2d
try to add fail page
rachel-sison May 13, 2024
11927be
Merge pull request #30 from UD-S24-CISC374/wrong-path
rachel-sison May 13, 2024
900852c
v4
rachel-sison May 13, 2024
e634e56
v3
rachel-sison May 13, 2024
10dd464
v3
rachel-sison May 13, 2024
36685f0
change back
rachel-sison May 13, 2024
fb91e2a
add fail scenes to config file
rachel-sison May 14, 2024
7ae8c92
added a tutorial
lizzykal May 14, 2024
1462968
fixing restart button in level four and working level 5
lizzykal May 14, 2024
d6f1b63
fixed fail message to be two lines
lizzykal May 14, 2024
5c4bb4a
fixing level 5
lizzykal May 14, 2024
1d4b0ac
adding sound effects to failing a level
lizzykal May 14, 2024
12f945e
fixing 4 and 5
lizzykal May 14, 2024
22fac3d
cleaning up unnecessary code
lizzykal May 14, 2024
2dcb74c
little fixes & readMe
rachel-sison May 15, 2024
59847b2
Merge branch 'main' into failedscene
rachel-sison May 15, 2024
2de258d
Merge pull request #31 from UD-S24-CISC374/failedscene
rachel-sison May 15, 2024
564c162
favico
rachel-sison May 15, 2024
1730ebc
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
rachel-sison May 15, 2024
d8f4d5b
fix restart and failed screen
rachel-sison May 15, 2024
de1c48e
Merge pull request #32 from UD-S24-CISC374/fixfail
rachel-sison May 15, 2024
26bea97
edit stone 1
rachel-sison May 15, 2024
0f67ef9
manifest
rachel-sison May 15, 2024
cd6e5f5
Update README.md
rachel-sison May 15, 2024
21bb371
making music loop
lizzykal May 16, 2024
199e240
fixed muisc overlapping when playing tutorial
lizzykal May 16, 2024
5989841
fixing restart button
lizzykal May 16, 2024
0313ae8
adding audio to passing level scenes
lizzykal May 16, 2024
3ecfac1
changed ending scene and added music
lizzykal May 16, 2024
48892c0
added sound when stones clicked in level 1
lizzykal May 16, 2024
fc4dabc
adding sounds to all levels when clicking on a stone
lizzykal May 16, 2024
7cfe756
little fixes
lizzykal May 16, 2024
4157d16
Update README.md
lizzykal May 17, 2024
96d60d1
shows steps after completing step before
lizzykal May 17, 2024
79b4f62
fix screenshot
rachel-sison May 20, 2024
e1f7249
Merge branch 'main' of https://github.com/UD-S24-CISC374/final-projec…
rachel-sison May 20, 2024
4bdd18b
small.png
rachel-sison May 20, 2024
bb00569
clean up
rachel-sison May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,61 @@
REPLACE THIS WITH A DESCRIPTION OF YOUR GAME (in the README.md file).
# Game Name

Cross the Pond

# Team Color

Brown

# Developers

- Rachel Sison (rsison@udel.edu)
- Lizzy Kalfas (lizzykal@udel.edu)

# Blurb

Oh no! You and your duck family have been seperated! You need to find your way back to each family member and bring them all together. Using Dijkstra's Algorithm you will find the shortest path of stepping stones across a pond to get to a family member on the other side. Complete each level to gain another member of your family back. Pass all five levels to reunite with your mother and become one big happy duck family again.

# Basic Instructions

Find the shorteest pathusing Dijkstra's Algorithm. Click each stone on your path starting with the stone labeled start

# Screenshot

![Screenshot of level 1](/docs/large.png)

# Gameplay Video

[Game demo](https://www.youtube.com/watch?v=pC5k8cKE9ow)

# Educational Game Design Document

Link to our [egdd](docs/egdd.md)

# Credits

Pond img: https://www.google.com/url?sa=i&url=https%3A%2F%2Fstock.adobe.com%2Fsearch%3Fk%3Dcartoon%2Bpond&psig=AOvVaw3vGnAdxl3dVewlfHfboCob&ust=1712347180978000&source=images&cd=vfe&opi=89978449&ved=0CBIQjRxqFwoTCKDMor-sqYUDFQAAAAAdAAAAABAE

Duck img: https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.freepik.com%2Fpremium-vector%2Fcute-duck-cartoon-vector-illustration_44380447.htm&psig=AOvVaw1GgLt8tCokW8d_WevV3Gkl&ust=1712347485292000&source=images&cd=vfe&opi=89978449&ved=0CBIQjRxqFwoTCJDvje6tqYUDFQAAAAAdAAAAABAE

Stepping Stones:https://www.google.com/url?sa=i&url=https%3A%2F%2Felchighland.com%2Fstepping-stones-2%2F&psig=AOvVaw0mxlnd_Qc6akzH6ufxYGhL&ust=1712350228058000&source=images&cd=vfe&opi=89978449&ved=0CBIQjRxqFwoTCODi7-q3qYUDFQAAAAAdAAAAABAE

Music:
Pass audio:

https://www.myinstants.com/en/instant/rubber-duckie/?utm_source=copy&utm_medium=share

Fail audio:

https://www.fesliyanstudios.com/royalty-free-sound-effects-download/sad-trombone-242

Background music:

https://pixabay.com/music/search/genre/cartoons/

Clicking on each stone sound:

https://www.myinstants.com/en/instant/duck-toy-sound-18073/?utm_source=copy&utm_medium=share

Winning audio:

https://pixabay.com/sound-effects/search/happy/
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/audio/sadTrombone.mp3
Binary file not shown.
Binary file added assets/audio/stepstone.mp3
Binary file not shown.
Binary file added assets/audio/theme.mp3
Binary file not shown.
Binary file added assets/audio/win.mp3
Binary file not shown.
Binary file added assets/audio/winning.mp3
Binary file not shown.
Binary file added assets/duck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/favicon.ico
Binary file not shown.
Binary file added assets/img/Storyboard1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Storyboard2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/mutebutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/phaser-logo.png
Binary file not shown.
Binary file added assets/img/unmutebutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/stone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.DS_Store
Binary file not shown.
166 changes: 165 additions & 1 deletion docs/egdd.md
Original file line number Diff line number Diff line change
@@ -1 +1,165 @@
REPLACE THIS TEXT WITH YOUR EGDD MARKDOWN.
---

waltz:
title: EGDD Example - Cross the Pond
meta:
version: 0.0.3
edd authors: - Rachel Sison <rsison@udel.edu> - Elizabeth Kalfas <lizzykal@udel.edu>

---

# Cross the Pond

# Overview

## Elevator Pitch

You have this cute duck that has been separated from its duck family by a pond. You aim to get to the other side of the pond using the stepping stones.

## Influences (Brief)

- Index the Cat:
- Medium: Game
- Explanation: The Index the Cat game immediately advances to the next level once you beat the previous one, which we’re implementing into ours.
- Crossy Road:
- Medium: phone game
- Explanation: Our game applies the same concept of getting to the other side.
- Quick Route:
- Medium: iPhone Game
- Explanation: The Quick Route game objective is to connect bubbles using the shortest path, which is similar to the objective of our game.

## Core Gameplay Mechanics (Brief)

- click stones to select a path for your duck
- click submit to check if the path chosen matches the shortest path
- pass level when you find the shortest path across
- if you cannot find the shortest path it will prompt you to try again
- move on to a higher level when the path is found
- when all levels are complete show the winner screen

# Learning Aspects

## Learning Domains

Introductory Data Structures

## Target Audiences

- Students being introduced to graphing algorithms
- Should be appropriate for adults who are young at heart.

## Target Contexts

- This would be assigned as supplementary practice in a course formally teaching the Dijksras Algorithm.

## Learning Objectives

- By the end of the lesson, players will be able to find the shortest path using Dijkstra’s Algorithm

## Prerequisite Knowledge

- Prior to the game, players need to be able to determine the distance between nodes in a graph
- Prior to the game, players should have a basic understanding of Dijkstra’s algorithm.

## Assessment Measures

A short pre-test and matching post-test should be designed to assess student learning.

- Given a graph, calculate the total distance of a path
- Given a graph, determine the shortest path across
- Given a graph, determine if a certain node is stopped during the shortest path

# What sets this project apart?

- Most introductory coding activities focus on code-writing, this can have a cute animal and graphics
- The gameplay mechanics of having the duck go to each rock to meet the desired goal of identifying the shortest possible path

# Player Interaction Patterns and Modes

## Player Interaction Pattern

This is a game for one person, they click on the mouse to move to different rocks in the pond.

## Player Modes

- Single-player: You repeatedly advance through rounds and levels until you reach the end.

# Gameplay Objectives

- Reunite with your family: When the shortest path is found you will be able to get across the pond and reunite with your family
- Advance to the next level: Once the shortest possible path is found you advance to advance to the next level
- Complete all the levels: Get through all the levels to win the game.

# Procedures/Actions

You click the mouse through the regions of the screen.

Some of those regions are different nodes representing a graph

# Rules

- If the player clicks on the wrong rocks thus submitting the wrong path, then the player loses
- If the player clicks the correct rocks, creating the correct path, then the duck is happily united with a member of its family
-If the player gets it wrong, they will be given a new path with diffrent values

# Objects/Entities

- There's a pond with rocks in it.
- There's a graph implemented using the rocks.
- Some instructions appear periodically at the bottom of the screen.

## Core Gameplay Mechanics (Detailed)

- Clicking/selecting rocks: You click/select multiple nodes (rocks) to complete the shortest path possible for the duck to get across the pond. Once the desired rocks are selected, you submit your answer.
- Correct path: If you correctly select/click the right rocks, essentially submitting the shortest possible path, the duck will be reunited with his happy family. Then the game will advance to the next round, switching up the numbers on the nodes to make it more difficult.
- Incorrect path: After selecting and submitting a path, if it is incorrect the duck will make a sad face/noise
- Various levels of increasing difficulty: There will be 5 levels each increasing in difficulty, the first level will just increase the number of nodes(stones) and connections between the nodes, and the last level will require the duck to stop at a certain stone before getting to the other side.
- All levels complete: After you complete all the levels, it displays a victory message. The ducks will all be together again.

## Feedback

- Text on the screen shows the current path selected as well as any previous paths submitted
- If an incorrect path is submitted 3 times a text showing the correct path will pop up.
- When you advance to a new level, the level text changes
- When you win the game, the ducks are all united.

# Story and Gameplay

## Presentation of Rules

- Text shown on the main game screen explains the objective and interaction instructions

## Presentation of Content

The game does not attempt to teach you Dijkstra’s Algorithm. This should be presented as supplementary content to help reinforce the topic.

## Story (Brief)

You are a cute little duck that has been separated from the rest of your duck family on the other side of the pond. To get back across the pond you have to use the stones as steps to find the shortest path back to reunite with your family. After you complete all the levels you win

# Assets Needed

## Aethestics

The aesthetics should be happy and cartoonish. The game should have a light-hearted feel. This should encourage the player to feel okay with their mistakes even as they try to do better.

## Graphical

- Characters List
- Duck
- Textures: N/A
- Environment Art/Textures:
- Pond:
- Stone:

## Audio

- Music List (Ambient sound)
- General gameplay: light cartoonish elevator music type
- Duck reunification: cheer/happy quacks
- Incorrect path: womp womp

## Story Boards

!(/assets/images/Storyboard1.jpg)
!(/assets/images/Storyboard2.JPG)
Binary file added docs/large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added pwa/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pwa/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pwa/icons/icons-192.png
Binary file not shown.
Binary file removed pwa/icons/icons-512.png
Binary file not shown.
4 changes: 2 additions & 2 deletions pwa/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "Phaser Game",
"name": "My Cool Phaser 3 Game",
"short_name": "Cross the Pone",
"name": "Cross the POnd",
"icons": [
{
"src": "./icons/icons-192.png",
Expand Down
39 changes: 37 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import Phaser from "phaser";
import MainScene from "./scenes/mainScene";
import levelOne from "./scenes/levelOne";
import levelOnePass from "./scenes/levelOnePass";
import levelTwo from "./scenes/levelTwo";
import levelTwoPass from "./scenes/levelTwoPass";
import levelThree from "./scenes/levelThree";
import levelThreePass from "./scenes/levelThreePass";
import levelFour from "./scenes/levelFour";
import levelFourPass from "./scenes/levelFourPass";
import levelFive from "./scenes/levelFive";
import endScreen from "./scenes/endScreen";
import mainMenu from "./scenes/mainMenu";
import PreloadScene from "./scenes/preloadScene";
import levelTwoFail from "./scenes/levelTwoFail";
import levelOneFail from "./scenes/levelOneFail";
import levelThreeFail from "./scenes/levelThreeFail";
import levelFourFail from "./scenes/levelFourFail";
import levelFiveFail from "./scenes/levelFiveFail";
import tutorial from "./scenes/tutorial";

const DEFAULT_WIDTH = 1280;
const DEFAULT_HEIGHT = 720;
Expand All @@ -17,7 +33,26 @@ export const CONFIG = {
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT,
},
scene: [PreloadScene, MainScene],
scene: [
PreloadScene,
mainMenu,
levelOne,
levelTwo,
levelThree,
levelFour,
levelFive,
levelOnePass,
levelTwoPass,
levelThreePass,
levelFourPass,
endScreen,
levelOneFail,
levelTwoFail,
levelThreeFail,
levelFourFail,
levelFiveFail,
tutorial,
],
physics: {
default: "arcade",
arcade: {
Expand Down
70 changes: 70 additions & 0 deletions src/scenes/endScreen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import Phaser from "phaser";

export default class endScreen extends Phaser.Scene {
private ducks: Phaser.GameObjects.Image[] = [];
constructor() {
super({ key: "endScreen" });
}

preload() {
this.load.audio("end", ["assets/audio/winning.mp3"]);
}
create() {
const { width, height } = this.sys.game.config;
const screenWidth = Number(width);
const screenHeight = Number(height);

this.add
.image(screenWidth / 2, screenHeight / 2, "pond")
.setDisplaySize(screenWidth, screenHeight);

const celebrationMusic = this.sound.add("end", {
loop: true,
volume: 0.5,
});
celebrationMusic.play();

this.add
.text(screenWidth / 2, 50, "Congratulations! You Won!", {
fontFamily: "Arial Black",
fontSize: "40px",
color: "#ffffe0",
})
.setOrigin(0.5, 0)
.setStroke("#ffd700", 16);

for (let i = 0; i < 5; i++) {
const duck = this.add
.image(
Phaser.Math.Between(100, screenWidth - 100),
Phaser.Math.Between(100, screenHeight - 100),
"duck"
)
.setScale(0.6);
this.ducks.push(duck);
this.tweens.add({
targets: duck,
y: { value: "-=100", duration: 500, ease: "Power2" },
yoyo: true,
repeat: -1,
delay: i * 100,
});
}

const backButton = this.add
.text(screenWidth - 50, screenHeight - 50, "Back to Menu", {
fontFamily: "Arial Black",
fontSize: "30px",
color: "#ffffe0",
})
.setOrigin(1)
.setStroke("#ffd700", 16)
.setInteractive();

backButton.on("pointerdown", () => {
celebrationMusic.stop();
this.scene.start("mainMenu");
});
}
update() {}
}
Loading