Skip to content

devshareacademy/phaser-4-falling-objects-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phaser 4 - Falling Objects

License

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.

Demo

You can find a playable demo of the game here: Falling Objects

Game play Screenshot Game play Demo

How To Play

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.

Requirements

  • A modern web browser
  • A local web server

Running Locally

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. Visit http://localhost:8080/ in your browser to see the game.
  • Node.js: If you have Node.js installed, you can use the http-server npm package. From the root of the project, run: npx http-server. This will start a local web server on port 8080. Visit http://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.

Writing Code

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.

Deploying Code

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.sh

This 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.

Customizing Code

VS Code Settings

The .vscode folder contains recommended extensions and settings for this project. You can customize or remove these as you see fit.

Static Assets

Any static assets like images or audio files should be placed in the assets folder. They can then be loaded into your game.

Issues

If you encounter any issues, please open a new GitHub Issue on your project's repository.

Questions, Comments, and Suggestions

If you have any questions, comments, or suggestions, please feel free to open a new GitHub Discussion on your project's repository.

Credits

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

About

A simple falling objects game created with Phaser 4! This repo contains all of the code used in the tutorial video that is hosted on YouTube here:

Resources

License

Stars

Watchers

Forks

Packages