Shop

Contributed by Chris Proctor

class quest.contrib.coin.CoinMixin[source]

Mixin to add collectable coins to your game. Coins are randomly placed around the walkable area of the game’s map.

coins_collected

the number of coins collected so far by the player

Note: The game this class is mixed into must define a total_coins property and a map_dimensions property.

See examples/contrib/shop.py for an example of how this mixin can be used.

setup_npcs()[source]

Randomly places coins around the walkable area of the map.

got_coin()[source]

Called when the player collides with a coin. Increments the coin property of the game.

class quest.contrib.coin.Coin[source]

A coin to be collected by the player

on_collision(sprite, game)[source]

When the player collides with a coin, it tells the game and then kills itself.