java - How to design classes based on requirements or functionality -
i'm struggling class design. think have read class organization, class diagram , class design can not apply concrete project. want create snake game in java using mvc or mvp architecture.
there requirements:
- the snake , food snake should drawn on screen
- it should displayed current game score
- the snake should move using key arrow
- the food should grouped each group have amount of point , color
- game speed should determined on score threshold
the question how organize classes (with methods , "all") according requirements? maybe have book or link suggest guidance or examples.
please share rule of thumb creating , organizing classes through example?
here example of simple snake game clone in java might refer ideas on how structure things.
since ask book recommendation, recommend book helped me immensely in grasping object oriented analysis , design. teaches solving real problems step step. quite different not follow typical flow of technical books on matter. looks @ gradually harder problems pointing @ potential problems , explaining important concepts along way.
the book called head first ooa&d. recommend because easy (and funny) read, lots of samples in java , on top of that, there game example in it. sure check out! outside context of problem think can benefit way did.
good luck!