/Projeto-CEN

Projeto da Disciplina de Computação em Nuvem da ISPGaya, com alguns mini jogos para auxiliar o ensino de cibersegurança à jovens

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Cybersecurity Arcade Games - Phaser 3

A Phaser 3 project template with ES6 support via Babel 7 and Webpack 4 that includes hot-reloading for development and production-ready builds.

This has been updated for Phaser 3.50.0 version and above.

Loading images via JavaScript module import is also supported, although not recommended.

API Architecture | Arquitetura da API

Requirements | Requisitos

  • NVM (0.38.0) is recommended to manage Node versions.
  • Node.js (16.16.0) is required to install dependencies and run scripts via npm.
  • Web Pack 5 is required to build the project.
  • Phaser 3 was used to develop the game.
  • ES6 is required to write the code.
  • AWS was used to deploy the project. (S3)
  • GCP was used to deploy the project. (App Engine)

Available Commands | Inicialização do Projeto

Command Description
npm install Install project dependencies
npm start Build project and open web server running project
npm run build Builds code bundle with production settings (minification, uglification, etc..)

Writing Code | Escrevendo o Código

After cloning the repo, run npm install from your project directory. Then, you can start the local development server by running npm start.

After starting the development server with npm start, 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 the Template | Customizando o 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 | Deploy do Código

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.

Deploying to App Engine (GCP) | Deploy no App Engine (GCP)

To deploy the project to App Engine, you need to have the Google Cloud SDK installed and configured on your machine.

Updating the project on App Engine | Atualizando o projeto no App Engine

  1. Login in your account:
gcloud auth login
  1. Set the project:
gcloud config set project cen-jogo-phaser
  1. Deploy the project:
gcloud app deploy
  1. Open the project:
gcloud app browse 

or https://cen-jogo-phaser.nw.r.appspot.com/

Contributing | Contribuindo

If you find any bugs or have a feature request, please open an issue with a description, steps to reproduce, and expected result.

License | Licença

General Public License v3.0