Lab 2: Text-Tiles
Lab 2:
Text-Tiles
Overview:
Creating a 2D-Map reader in Python & Pygame. Students will reinforce their fundamentals in object oriented programing and file parsing.
Objectives:
MORE brushing up on Python & Pygame..
Indepth object oriented programming.
FIle parsing & string manipulation.
Mission:
Create a Map Module
Constructor takes an map file location.
Parses file to set parameter for map.
Header
Map Height & Width
Map Tile Height & Width
Tileset
Image name
Tileset Tile Height & Width
Tile Spacing
Layers
Generate a 2D Array of Ints
Load Image
Only load this once.
Render
Render map to a surface given as a parameter.
Create a main Game program
Import the map module
Create your game loop
Create an instance of your map.
Good Design & Documentation
Use Docstrings on methods, functions and classes
Comment code where needed.
Good method, function, class, and variable names.
Bonus Ideas:
Create a character than can move
Collision with obstacles
Multiple layers
Background, Walls, Foreground, etc