Giter Club home page Giter Club logo

super-simplified-mario's Introduction

Super Simplified Mario ๐Ÿ„


This is my humble attempt to implement the core mechanics of this great game.
There is a lot missing here to create exciting gameplay, but I tried to make
the code easy to extend using programming patterns that I know

Used technologies โš™๏ธ


JavaScript
HTML
CSS

Paradigm โœ…


OOP

License ๐Ÿ”’


MIT License

super-simplified-mario's People

Watchers

Mykola Kushnir avatar

super-simplified-mario's Issues

Code review

  1. Use curly brackets for multiline if-statements https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/input.js#L5-L6
  2. Use curly brackets for callbacks with imperative logic: https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/input.js#L8C37-L10
  3. Instead of https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/public/game/game-main.js#L29-L35
    if (!isMusicOn) soundPlayer.play('gameInProgress');
    else soundPlayer.pause('gameInProgress');
    isMusicOn = !isMusicOn;
  1. When we have {}-block in positive branch, add {}-block for else too - https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/public/game/game-main.js#LL103C33-L103C33
  2. Rewrite https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/game/map/background.js#L30-L32 to: this.box.pos.x = /* ternary here */
  3. Ditto: https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/game/map/background.js#L43-L45
  4. Put function into variable (constant) and call it: https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/game/map/background.js#L52-L54
  5. Add block - https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/game/map/background.js#L59-L61
  6. Ditto - https://github.com/kushnirko/super-simplified-mario/blob/13de5cc9d9ef1e18a0f5e234d66ce36c572349f9/scripts/game/map/background.js#L65-L66
  7. Use intermediate variables https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/map/map.js#L87-L89
  8. Que dest? Such a nesting i mean https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/map/map.js#L126-L132
  9. Magic number: https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/game.js#L43-L44
  10. Do not write multilene if conditions https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/game.js#L51-L55
  11. Magic https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/game.js#L51-L55
  12. Use intermediate vars https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/game.js#L51-L55
  13. Que dest? https://github.com/kushnirko/super-simplified-mario/blob/6575af28ff6e99ec383f4e8202b713f8ac161f38/scripts/game/utils.js#L3-L6
  14. Code style is not consistent, add linter (eslint, prettier, ts)

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.