Generical classe and functions from Pygame to make the graphical user interface (GUI). This script provides shortcuts and utilities to other modules, but it can also be used to check the compatibility with pygame.
In a terminal, launching the scrit, with $ ./AffichPygame.py, will launch a demo.
Warning
The Python binding to SDL, Pygame, is required for the project as well as for this demo.
This show how the graphical window looks like during the game (for the client) :
- This module use the datas store in ./datas/ folder.
- The sprites are made with ‘.png’ pictures, usually this is supported on every platform;
- The soundtrack is made with ‘.mp3’ tracks.
Warning
- On some Linux distribution mp3 are not supported !
- Maybe we have to install some extra libs.
Or maybe you don’t have a sound server.
Hint
You can disable music for the client and the bot with the –nomusic and –nosoundeffect options.
Here are stored all the sound used for the game. Those mp3 music tracks are used by the client.
The music can be disable with the –nomusic option, or you can force to try to launch it with the –music option.
- battle.mp3, menu.mp3, oeuf.mp3 : One of those 3 is chosed for the soundtrack of the game (and play in loop).
- explosion.mp3 : When a bomb blow.
- item.mp3 : When a new bonus is catched (not yet fully implemented).
- world_clear.mp3 : When the game is done (and only if you wan !).
The soundtrack is from many different sources. This is an exhaustive list :
- The Legend of Zelda - Ocarina of Time, Link’s awakening (Nintendo (c) 1991 & 1997);
- Super Mario World 1 (Nintendo (c) 1985);
- Super Smash Bros Melee (Nintendo (c) 2001 - HAL Laboratory),
The game is released under the GPLv3 Licence, but the soundtrack is not distributed freely with the game (at least, not under a free licence). Although, you can download it from the same source that the game (just not in the same archive).
Here are stored all the pictures used for the game. Those png pictures are used by the client, to build a GUI with PyGame.
The GUI can be disable with the –nowindow option, or you can force to try to launch it with the –window option. The game should run without any additionnal window. But maybe it require an X server anyway.
- block_destr.png, block_undestr.png: For the wall (destructible or not).
- player{0|1|2|3|4|5|6|7|8|9}.png : For the players (many different models).
- bomb_{1|2|3|4} : For the bombs (many different models).
The soundtrack is from many different sources. This is a non exhaustive list.
- Pacman (Nintendo (c) 1991);
- Super Mario World 1 (Nintendo (c) 1985);
- Pokémon Red/Blue (Nintendo (c) 1995 - GameFreak).
Moreover, some images were made with an online generator [http://www.softicons.com/icon-tools/icon-converter], so you can also use this to make your own !
The game is released under the GPLv3 Licence, but the soundtrack is not distributed freely with the game (at least, not under a free licence). Although, you can download it from the same source that the game (just not in the same archive).
Warning
- Try to update the sprite only when it changed.
- Find a cool sound for game over.
For a destructible spot.
For an undestructible spot.
For players.
For players.
For bombs.
For bonuses.
For a spot with a bonus.
When a player (not the active one) win the game.
When the active player get a bonus.
When a bomb is exploding.
Random : choose from this list !
Convert one of the following color [‘black’, ‘red’, ‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, ‘white’], to an integer between 1 and 8 (to choose the right picture).
A test to use a picture as an array of sub pictures.
Give the name of the picture used to print the state.
If more than one player is in the same spot, return the first one.
Load a picture, and return a image object.
Load a music. Set the volume to volume, and play it number time. To play in loop, set number=-1.
The default soundtrack is from many different sources. This is an exhaustive list :
- Pokemon Red (Nintendo (c) 1995 - GameFreak);
- The Legend of Zelda - Ocarina of Time, Link’s awakening (Nintendo (c) 1991 & 1997);
- Super Mario World 1 (Nintendo (c) 1985);
- Super Smash Bros Melee (Nintendo (c) 2001 - HAL Laboratory).
Although, you can download it from the same source that the game (just not in the same archive).
Bases: pygame.sprite.Sprite
A simple class for a spot (instance of Board.State) in the board. This one is more oriented around moves by direct order.
FIXME: use update ?
Spot is a wrapper around Board.State, and state is attend to be one of this.
The Spot contain a state.
If true, try to update ony the changed sprites.