Giter Club home page Giter Club logo

40phaser's People

Contributors

alexperez avatar dependabot[bot] avatar gonzen2310 avatar jakemhiller avatar jenesh avatar joshuakgoldberg avatar linkcoding avatar neilzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

40phaser's Issues

Set up code to be imported as a function

Along with #6 (publishing an npm package), we'll want this to be importable as an npm module. Ideally something like:

import { launch40Phaser } from "40phaser";

window.onload = () => {
  launch40Phaser({
    buttonGameStart: document.getElementById('game-start'),
    buttonGameReplay: document.getElementById('game-replay'),
    app404: document.getElementById('app-404'),
    appEnd: document.getElementById('app-end'),
  });
};

Update 'Build your own' text to be more descriptive

Currently, the text in a button that leads to the Phaser Course reads as 'Build your own'.

This text should be more descriptive to match its action.
Also, consider linking to the skill path instead of the course. (Double check free vs pro statuses on each).
If the course is free - leave the link as is.

Make game higher resolution

Right now because of the resolution, it look a bit illegit like a sidebar ad.

If there's some kind of way to use vector fonts or render the canvas at higher resolution, it would fit in better with the rest of the Codecademy site!

Tapping the screen should trigger a jump

I want to be able to play this thing on my phone when viewing the 404 page in Desktop Mode 😄. The game works but there's no way to control the player. Let's have them jump when the screen is touched.

Implement Personal High Score

  • Add default highScore variable
  • Store highScore value in localstorage
  • Add check if current score is greater than local storage and replace if it is

Allow gameplay without a mouse

Following #7: results came back in and the game would benefit from having have shortcuts everywhere, such as for folks who don't have a mouse. Right now it only has shortcuts for some actions (namely P to pause/play).

Use class variables to contain state instead of standalone variables

There are two styles of storing state info in scene files:

  • Standalone variable: let someState = false;
  • Class members: this.someState = false;

Standalone variables don't cause bugs directly, but can lead us to introducing bugs if we don't properly reset them when entering a scene.

Add logic to end screen text

Currently, when a player hits the end screen they'll always see the text: "So Close!".

There should be some logical check for how the current score compares to the existing high score (if it exists at all) and display matching text.
For instance:
If the scores match ("Wow! Same high score!")
If a new high score ("Amazing, new high score!")
If less than high score ("So Close!") or ("Maybe next time")

The text can also be randomly chosen from an array of possible sayings.

Implement End State

There's currently a placeholder state, the task would be to implement the end state so that 'game over' message appears, players can see their score and play again.

Add TypeScript type definitions

We've duplicated a type definition for this repo a few times now:

To DRY things up, we should add this definition to this repo.

The type def we've used (at time of this issue creation) is:

declare module '40phaser' {
  export type LaunchOptions = {
    phaser?: typeof Phaser;
    phaserOptions: {
      parent?: string;
    };
  };

  export const launch40Phaser: (options: LaunchOptions) => void;
}

Easter Egg to link to this repo

I think an "invisible box/button" that links to this repo would be a nice to have.
Couple of ideas:

  • Add a new HTML button
    • Have it in a corner and set to "visible: none"
  • Provide a title so it shows some intriguing text on hover.
  • Clicking on the button will open a new tab that links to this repo

Figure out how Phaser messages and switches between scenes

Following #17:

I don't know Phaser best practices and I don't know how to message pass between scenes... in the meantime, made a state.js file that keeps the game so they can start other scenes. I'm hoping there's an easier way to get around this.

Allow users to pause game using "p" key

Currently, users can only pause the game by clicking the "pause" button.

It would be nice to add an event listener to the "p" key to also allow for pausing.

Additional, if possible underline "P" in "pause" to suggest it does something.

Pass Score from one Scene to another

  • Send score from GameScene to EndScene.
    • Update EndScene's HTML to display final score
  • Then restart score during the transition from EndScene to GameScene.

Injecting your own Phaser does not actually work

🙃

There are two types of places in code that still rely on a global (window) Phaser object existing:

  • index.js, which contains type: Phaser.AUTO
  • Scene classes that extend from Phaser.Scene

Both of the above crash if the global doesn't exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.