-
Notifications
You must be signed in to change notification settings - Fork 2
Overview
At a high level, the application runs a "game loop" via GameController at a fixed interval to fetch character information and position and pellet locations. These two actions are registered in CharacterManager and PelletManager respectively. The API client PacMacroClient performs the calls and posts received data on to the global EventBus. The EventBus takes events in the form of objects, and classes can subscribe to events by defining methods that take the same type object as the event as a parameter and are annotated with the @Subscribe annotation. CharacterManager and PelletManager register their own listeners on the EventBus to react to relevant events, such as receiving their data, and handle that data appropriately.
Initialization of the above is done within each of the activities (PlayerActivity and SpectatorActivity).
When the user is acting as a player (ie. they're in PlayerActivity), the PlayerService is started and runs in the background fetching the current location and pushing that information to the server. The location update is run outside of the GameController loop. Additionally, when a player tags another player, the tag request is also sent outside of the GameController loop. The PlayerActivity shows a button for tagging another player, and exiting (the gruntwork is done in the PlayerService).
SpectatorActivity has a map populated with the characters in the game, updated via the GameController setup as described above.
- Home
- Overview
- Configuration
- Reference
- Activity and Fragment
- API
- Controller
- Model
- Other functionality