Jump to content

  • Log In with Google      Sign In   
  • Create Account


zdlr

Member Since 30 Jun 2002
Offline Last Active Nov 13 2013 10:38 AM
-----

#5086471 Critique my code please

Posted by zdlr on 16 August 2013 - 07:20 AM

mepis, I've sumitted a couple of pull requests that address one or two of the points I mentioned above.




#5086104 Critique my code please

Posted by zdlr on 15 August 2013 - 07:34 AM

  1. Every time you add a new item, you have to change the GameWindow.paint method.
  2. You have a lot of hardcoded magic numbers. Like 16666666..., (userInput == 38), (userInput == 40), etc.
  3. Some objects are not encapsulated very well. Ball is just a bag of data which doesn't do anything, just holds values. It also holds values not specific to ball, like window measurements.
  4. What is the purpose of GameLoopTimer? It looks like it could be used to make movement framerate independent, but it is not used for that. Is the frequency of GameWindow.paint calls fixed in Java, or does it vary with the speed of the machine?
  5. What is the purpose of the isHard boolean?
  6. GameWindow has too many responsibilities - drawing, input detection and response, general initialization, object creation, object movement. It should delegate a lot more to other classes. 



PARTNERS