GithubHelp home page GithubHelp logo

prg01-8_game's People

Contributors

milansosef avatar

Watchers

 avatar  avatar  avatar

prg01-8_game's Issues

Peer review - week 6

Strictly seen, you could improve your code by using getters and setters to access instances of libraries (like PIXI) defined in class Game. In your case, only a getter would be appropriate since other classes are not allowed to overwrite these libraries.

Singleton

The singleton pattern has been implemented in the Game class but you forgot to make the constructor private.

When implementing the singleton pattern the constructor should be private. If the constructor is not private, anyone can make an instance of Game and it would no longer be a singleton. For a singleton by definition there can exist only one instance.

Polymorphism

Currently you are using polymorphism in one place in your code. Inheritance is used since class Player extends from GameObject. For the final assessment you will need to have 2 implementations of polymorphism. Do remember that polymorphism used in the strategy or observer pattern does not count as an implementation of polymorphism.

Strategy

It looks like you made a start with the strategy pattern, though your implementation does not seem to be finished. You have an interface for different types of movement, but there is only one type of movement: walking. In the player class you define the type of movement at:

private movement:Movement = new Walking(this)

The strategy pattern is correctly implemented, you just need to add another type of movement that you can switch between.

Observer

Oberver pattern has not been implemented yet.

Your game is looking good so far! Keep up the good work.

Peer Review

Je hebt heel goed nagedacht over wat je in je game wilt hebben en maakt goed gebruik van tools die beschikbaar zijn. Met de combinatie van PIXI, Howler & Tiled heb je een hele toffe combinatie aan Game Aesthetics!

Je hebt de meeste patterns volledig verwerkt in je game:

  • Je Game is een singleton waardoor er maar één game aan te kunnen maken. (Voor Player geldt hetzelfde!)
  • De Entity implementeert een Subject en Gun implementeert de observer. Wanneer een Entity zich update doen de observers van die Entity dat ook.
  • Doordat een Entity een Movement heeft (die bijvoorbeeld van het type Walking is maar ook een ander type zou kunnen hebben) en aangepast zou kunnen worden. Hiermee pas je de Strategy pattern correct toe. Zorg er in ieder geval voor dat je uiteindelijk in runtime van Movement kan wisselen.
  • De basis van Polymorphism heb je: je Player is een Entity en een Pistol is een Gun.

Je mist nog twee dingen: Type Assertion en Type Guards. Op dit moment ben je nog een is stage van development dat dit niet optimaal is toe te passen. Maar denk bijvoorbeeld aan mogelijkheden voor
type guards wanneer je Enemies gaat toevoegen. Als je ook nog van plan bent om menuschermen te implementeren kan type Assertion bij clickEvents ook erg van pas komen.

Ik ben heel benieuwd naar het eind resultaat van je game, zeker met de kwaliteit van je animaties van nu! Success met het laatste stuk 😸

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.