Opening the book…
The level object contains a game state object (which will be the state used when the level first starts), a map object, and a few other values. The level object itself is a dictionary with the following keys:
- The value at the key
'width'is an integer of how many tiles wide the entire map is. - The value at the key
'height'is an integer of how many tiles tall the entire map is. - The value at the key
'mapObj'is the map object for this level. - The value at the key
'goals'is a list of two-integer tuples with the XY coordinates of each goal space on the map. - The value at the key
'startState'is a game state object used to show the starting position of the stars and player at the start of the level.
This page titled 10.7: The “Levels” Data Structure was last modified on Mon, 11 Nov 2019 01:45:30 GMT and is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Al Sweigart via source content that was edited to the style and standards of the LibreTexts platform.
The book could not be loaded just now.