-
Notifications
You must be signed in to change notification settings - Fork 3
GameScreen
The main screen of the game where all of the actual flight- and waypoint-related logic starts.
Accepts the GameDifficulty variable, which is passed on to AircraftController (AircraftController).
Also initiates all of the UI elements:
// create a table layout, main ui
Table ui = new Table();
// create a separate layout for sidebar with all the buttons and
// required info
Table sidebar = new Table();
// create and add the Airspace group, contains aircraft and waypoints
Airspace airspace = new Airspace();ui basically holds both the sidebar and airspace, first of which is another table which is used as a wrapper for all of the elements in the sidebar (simplifies management of the layout).
Basically calls the Stage's draw method which in turn calls all of the draw method of all of the actors in the stage. For more info about the Stage/Actor logic see Stage/Actor
Beside the actual drawing of elements, the altitude numbers below the aircraft is also drawn in this method (as it is separate from the actual drawing of the aircraft).
Calls the AircraftController's update method which in turn calls all of the logic, again, see AircraftController for more info.
root.act() allows for all button and input (such as keyboard and mouse) to work properly. In general, following the Stage/Actor logic, this should also "act" the actors on stage, however, to simplify the code the update method of every aircraft is called manually.