Island (Discrete)

Almost the same as Island, this version uses DiscretePhysicsEngine instead. The player moves from tile to tile, starting and ending each move in a specific location.

../_images/island_game.png
class quest.examples.island_discrete.IslandAdventureDiscrete[source]

An alternate version of Island Adventure, using discrete movement.

To run this example:

$ python -m quest.examples.island_discrete
setup_maps()[source]

Sets up the map.

Uses a TiledMap to load the map from a .tmx file, created using Tiled.

setup_walls()[source]

Assigns sprites to self.wall_list. These sprites will function as walls, blocking the player from passing through them.

setup_physics_engine()[source]

Uses DiscretePhysicsEngine instead of the standard ContinuousPhysicsEngine. The result is that the player snaps to a grid instead of moving smoothly to any position.

A game’s physics engine is responsible for enforcing the rules of the game’s reality. In a fancy 3d game, the physics engine is full of intense math to keep track of objects flying around, bouncing off of walls, and breaking into pieces.

Quest’s physics engines are simpler. They just need to make sure nobody walks through walls, and to check when sprites collide. There are two physics engines built-in: A continuous (the default) and a discrete (used here).