Package Structure - GameDevWeek/CodeBase GitHub Wiki
This is a recommended package structure, to keep things clean and easy to understand. You are of course free to adapt this, as long as it helps structuring your code.
de.hochschuletrier.gdw.ss15
Your base package path. Feel free to adapt this as needed.game
Everything related to a game instancecomponent
Componentsfactories
Factories for components
contactlisteners
Physix contact listenersdata
Raw data objects (Enums or Classes (not components) that contain data but no logic)datagrams
Datagram classes for NetCodeinterfaces
Interfaces (in case you need any)systems
System classes. For bigger games, create sub-packages like this:input
network
rendering
menu
Menu classessandbox
Contains sandboxes inside of sub-packagessound
an example sandbox package
states
States defining at what point in the application we are (loading, mainmenu, game, ..)
Want to see this in action?
If you want to see how this looks in an actual game, check out the Survival of the Fattest project.
This is a fully featured network game I use to show off new Code when applicable. It was a GDW Game from summer 2012, but has since been heavily rewritten to serve as an example for good practices and newest technologies.