https://github.com/lucasctnh/sub-treasure-hunter
🦈 A simple "get the treasure" game I made for fun.
https://github.com/lucasctnh/sub-treasure-hunter
javascript learning-by-doing nodejs phaser3 webpack
Last synced: 6 months ago
JSON representation
🦈 A simple "get the treasure" game I made for fun.
- Host: GitHub
- URL: https://github.com/lucasctnh/sub-treasure-hunter
- Owner: lucasctnh
- License: mit
- Created: 2021-01-02T02:49:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T00:17:43.000Z (almost 3 years ago)
- Last Synced: 2025-01-28T12:45:59.969Z (over 1 year ago)
- Topics: javascript, learning-by-doing, nodejs, phaser3, webpack
- Language: JavaScript
- Homepage: https://treasure-hunter-game-sub.web.app/
- Size: 352 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# S.U.B - A Treasure Hunter Game

This is a simple game I've made just to get familiarized with the game framework
[Phaser 3](https://phaser.io/). I also did the sprites myself, which made the
project more satisfying to do.
A demo can be found [here](https://treasure-hunter-game-sub.web.app/).
## Requirements
[Node.js](https://nodejs.org) is required to install dependencies and run scripts via `npm`.
## Available Commands
| Command | Description |
|---------|-------------|
| `npm install` | Install project dependencies |
| `npm start` | Starts project with the dev-server with development settings |
| `npm run build` | Builds code bundle with production settings (minification, uglification, etc..) |
| `npm run devbuild` | Builds bundle and runs dev-server with production settings |
## Writing Code
After cloning the repo, run `npm install` from your project directory. Then, you
can start the local development server by running `npm run dev`.
After starting the development server with `npm run dev`, you can edit any files in the `src` folder
and webpack will automatically recompile and reload your server (available at `http://localhost:8080`
by default).
## Customizing Template
### Babel
You can write modern ES6+ JavaScript and Babel will transpile it to a version of JavaScript that you
want your project to support. The targeted browsers are set in the `.babelrc` file and the default currently
targets all browsers with total usage over "0.25%" but excludes IE11 and Opera Mini.
```
"browsers": [
">0.25%",
"not ie 11",
"not op_mini all"
]
```
### Webpack
If you want to customize your build, such as adding a new webpack loader or
plugin (i.e. for loading CSS or fonts), you can modify the `webpack/base.js`
file for cross-project changes, or you can modify and/or create
new configuration files and target them in specific npm tasks inside of `package.json'.
## Deploying Code
After you run the `npm run build` command, your code will be built into a single bundle located at
`dist/bundle.min.js` along with any other assets you project depended.
If you put the contents of the `dist` folder in a publicly-accessible location (say something like `http://mycoolserver.com`),
you should be able to open `http://mycoolserver.com/index.html` and play your
game. In my case, I'm using Firebase to deploy it.