A simple falling objects game created with Phaser 4!
Phaser Version: 4.0.0
This repo is the official code repository for the Build Your First Game with Phaser 4 free course that is available on YouTube.
You can find a playable demo of the game here: Falling Objects
Move the basket left and right with the Left and Right arrow keys, and try to catch as many falling candies as possible to get the high score.
- A modern web browser
- A local web server
You need to run a local web server to see the game running. Here are a few options:
- Python: If you have Python 3 installed, you can use the built-in http.server. From the root of the project, run:
python3 -m http.server 8080. This will start a local web server on port 8080. Visithttp://localhost:8080/in your browser to see the game. - Node.js: If you have Node.js installed, you can use the
http-servernpm package. From the root of the project, run:npx http-server. This will start a local web server on port 8080. Visithttp://localhost:8080/to see the game. - VS Code Extension: If you use VS Code, you can install the Live Server extension to run a local web server.
This template is set up for a modern JavaScript development workflow without any build tools. Simply start your local web server and begin editing the files in the src folder. Your changes will be reflected when you refresh your browser.
The main entry point for the application is src/main.js.
This template includes a bundle script to gather all the necessary files for deployment into a dist folder.
To create a distributable bundle, run the following command from the root of the project:
bash scripts/bundle.shThis will create a dist folder containing your game. The contents of this folder can then be uploaded to any static web hosting service. The script will exclude the src/types directory from the final bundle.
The .vscode folder contains recommended extensions and settings for this project. You can customize or remove these as you see fit.
Any static assets like images or audio files should be placed in the assets folder. They can then be loaded into your game.
If you encounter any issues, please open a new GitHub Issue on your project's repository.
If you have any questions, comments, or suggestions, please feel free to open a new GitHub Discussion on your project's repository.
This project would not have been possible without the art provided by the following people:
| Asset | Artist | Source |
|---|---|---|
| Background | Sirirat Changhuana | Vecteezy - Background |
| Blue Thread | Timplaru Emil | Vecteezy Blue Thread Spool |
| Red Thread | Timplaru Emil | Vecteezy Red Thread Spool |
| Yellow Thread | Timplaru Emil | Vecteezy Yellow Thread Spool |
| Green Thread | Timplaru Emil | Vecteezy Green Thread Spool |
| Needles | Timplaru Emil | Vecteezy Needles |
| Buttons | Timplaru Emil | Vecteezy Buttons |
| Jar | Timplaru Emil | Jar |

