Table of contents
Map
What does the Map class do?
The Map
class (found in the Level
package) is responsible for updating and drawing nearly everything during the game, which includes the map tiles, the camera (current view – which part of the map is being shown on the screen), NPCs, etc. It has a lot of duties to carry out, but a vast majority of the Map
class is just “setup” – once everything is ready to go, it just continuously calls update
on every class instance it holds and lets them decide what they want to do.
Everything you see in the below gif is handled/coordinated by the Map
class or its Camera
class instance. The only exception is the player, which has its own class Player
.