You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general, your game is nice and fun. You managed to create a cool game with great potential for growth, and with an implementation that remained clean, which will help with new additions, and modifications. It's hard to write a program thinking about what will happen in the future, but it's important to keep all the ideas you have in mind, and try to write the game from the beginning that is adaptable - you can do that with the use of Inheritance (try to program with superclasses/interfaces instead of the subclass - take a look at the polymorphism materials), and by organizing your code, thinking when and where you are instantiating the objects and organizing your project structure.
Looking in particular to your Game class I would advise you to pay special attention to the access modifiers: having the class properties as private is a good practice, so you can restrict the access and their modification. The same logic applies to methods that are only used inside their own class (the only two methods you invoke outside of this class are start() and setCar(), so all the other methods - excluding the setters - can be set to private). It's a good way to make sure your code remains readable and becomes more secure.
It would be nice to have a few things to improve user experience, like an initial page with instructions; a button to quit the game.
If you plan, in the future to add more types of obstacles/enemies, or even different elements, like clients, you should start thinking on how to make your code more scalable (that is, more prepared to grow and adapt to the changes without having to rewrite everything): consider the use of superclasses or interfaces, and the application of a few design patterns (the ones I would suggest for your program would be the Factory DP and the Strategy DP). Organizing your classes in directories should also help.
Can't wait to see the changes that you'll implement and to play again! Keep up the good work!
The text was updated successfully, but these errors were encountered:
In general, your game is nice and fun. You managed to create a cool game with great potential for growth, and with an implementation that remained clean, which will help with new additions, and modifications. It's hard to write a program thinking about what will happen in the future, but it's important to keep all the ideas you have in mind, and try to write the game from the beginning that is adaptable - you can do that with the use of Inheritance (try to program with superclasses/interfaces instead of the subclass - take a look at the polymorphism materials), and by organizing your code, thinking when and where you are instantiating the objects and organizing your project structure.
Looking in particular to your Game class I would advise you to pay special attention to the access modifiers: having the class properties as private is a good practice, so you can restrict the access and their modification. The same logic applies to methods that are only used inside their own class (the only two methods you invoke outside of this class are start() and setCar(), so all the other methods - excluding the setters - can be set to private). It's a good way to make sure your code remains readable and becomes more secure.
It would be nice to have a few things to improve user experience, like an initial page with instructions; a button to quit the game.
If you plan, in the future to add more types of obstacles/enemies, or even different elements, like clients, you should start thinking on how to make your code more scalable (that is, more prepared to grow and adapt to the changes without having to rewrite everything): consider the use of superclasses or interfaces, and the application of a few design patterns (the ones I would suggest for your program would be the Factory DP and the Strategy DP). Organizing your classes in directories should also help.
Can't wait to see the changes that you'll implement and to play again! Keep up the good work!
The text was updated successfully, but these errors were encountered: