Giter Club home page Giter Club logo

pacmangame's Introduction

๐ŸŽ“ Student: KPI / IM-11 ๐Ÿ‘ท Speciality: Software engineer / Full Stack
๐Ÿ’ก Skills ๐Ÿงป Projects ๐Ÿง‘โ€๐Ÿ’ป Stack: HTML, CSS, JS, TS, React.js, Node.js, Express.js, MongoDB, MySQL ๐Ÿ“ซ [email protected]

pacmangame's People

Contributors

hatrison avatar hutrison avatar

pacmangame's Issues

Code review

  1. Terrible code:

    PacManGame/src/js/Enemy.js

    Lines 100 to 110 in 811b924

    isCollision(pacman) {
    const size = this.size / 2;
    if (
    this.x < pacman.x + size &&
    this.x + size > pacman.x &&
    this.y < pacman.y + size &&
    this.y + size > pacman.y
    )
    return true;
    else return false;
    }

    See following:
  isCollision(pacman) {
    const size = this.size / 2;
    const { x, y } = pacman;
    const x2 = this.x + size;
    const y2 = this.y + size;
    return this.x < x2 && x2 > x && this.y < y2 && y2 > y;
  }
  1. Use collection instead of switch/case:
    switch (this.direction) {
    case directions.up:
    this.y -= this.speed;
    break;
    case directions.right:
    this.x += this.speed;
    break;
    case directions.down:
    this.y += this.speed;
    break;
    case directions.left:
  2. Multiple nested loops and deeply enclosed if-statements are detected.
  3. Multiline if-conditions are not readable
  4. Hardcoded magic numbers

Need interview or refactoring to pass exams

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.