Magicor! - The cool penguin saves the world

Magicor project site Magicor project site on SourceForge

Magicor! - The cool penguin saves the world


Here are some of the questions (and answers) I've recieved that might be of importance:

1 Running Magicor

2 Installation

1 Running Magicor

1.1 @property SyntaxError: invalid syntax

Yes, decorators are new in Python 2.4. As the requirements list states, Python 2.4 (or higher) is a prerequisite for running Magicor.

1.2 pygame.error: No available audio device

Do you have sound working? If you're using ALSA, try setting the environment variable AUDIODEV to an appropriate ALSA pcm playback device, you might need to make it a dmix plugin.
If all fails you can still play the game by adding the -s 0 option to the Magicor program.

1.3 ImportError: No module named magicor

This can be due to a number of reasons:

If you don't want a system-wide installation of Magicor, try running magicor from the unpacked directory, it's been verified to work on both POSIX and Windows systems.

2 Installation

2.1 How do I edit the Makefile properly?

Use your favourite editor and change any of the top variables. Comments have been added to help you (lines starting with #). Here's an example of how to install Magicor on a pretty standard GNU and/or BSD OS:

# Do not change this unless you know what you're doing.
PYTHON_VERSION=$(shell python -c "import sys; print sys.version[:3]")

# The prefix is added as a prefix (duh) to all other paths as default.
# Where the magicor package will be installed, including final directory.
# Where the executable scripts will be installed.
# Where the shared data will be stored.
# Where to find the system-wide config file.

This will result in the following directories being used (assuming Python 2.4 is default):

NOTE! If you install and run the game using different version Python it will not work since each Python version has it's own library. Note the version number in the library path.

2.2 How do I install on Windows?

Thanks to Claudio Canepa's (claxo) patching the game now runs on Windows as well.

Simply unpack the game and run or

2.3 How do I install the requirements on Debian?

Here's a one-liner that works with Debian (woody and etch):

apt-get install python2.4 python-pygame libsdl-image1.2 libsdl-mixer1.2

and for the editor requirements:

apt-get install python-gtk2 libglade2-0

(the above line might require another libglade package name for woody?)

2.4 Installing and playing additional levels

There are two ways to install and play new levels. But first the simple instructions on how to install and play the original theme levels:

Simply unpack the theme tarball in your levels directory. See below for info on where the levels directory might be.

Now, let's go on describing how levels and themes work.

The first way is to copy the .lvl-file to the system wide levels directory. For GNU and BSD this destination was set in the Makefile. If you used defaults the path is /usr/local/share/magicor/levels.

If you used a theme the level file must be in that theme directory. Example: my-egyptian-level.lvl should be copied to /usr/local/share/magicor/levels/egypt .

The second way is to copy the .lvl-file to the alternative user path (set "user_path" in the config, or ~/.magicor is assumed). Again, themed levels must be in a directory named as the theme.

Example: my-egyptian-level.lvl should be copied to ~/.magicor/levels/egypt.

Resources for themes are searched in both the "data_path" and "user_path" locations.

2.5 Installing custom themes

A theme is just a directory with resources (graphics and audio). The theme name is the directory name. All levels using this theme must be put in a directory with the same name. For convenience you can distribute your levels in your theme directory, as with the game's original themes.

Small theme example with custom tile, background and music:

mkdir ~/.magicor/levels/my-theme
cp my-tile.png ~/.magicor/levels/my-theme/
cp my-music.ogg ~/.magicor/levels/my-theme/
cp my-background.jpg ~/.magicor/levels/my-theme/

When distributing themes, please zip/tar/rar/pack WITH the directory of your theme. Example:

cd ~/.magicor/levels
zip my-theme

Done. Note that the location ~/.magicor/levels can be replaced with the system wide levels-path as set by your installation. On GNU and BSD this defaults to /usr/local/share/magicor/levels.