# What is Open Surge™?

Open Surge™ is an open source retro-style 2D sidescroller inspired by old-school games. Join Surge, Neon and Charge and save the world from the evil Gimacian the Dark! This version, 0.2.0, features:

- One level: Sunshine Paradise.
- A nice story with charismatic characters!
- Physics: slopes, loops, etc.
- Translations to multiple languages!
- A level editor and a highly moddable engine!
- Good performance even on old computers!
- The complete source code!

Open Surge™ is available for Windows, Linux and other platforms.

# How to play

## Starting the game

Run the opensurge program.

## Menu

- Start Game: starts the 1-player game mode;
- Options: options screen;
- Exit: quits the game.

## Moving your character

You can play using a keyboard or a gamepad. If you decide for the latter, plug it before you start the game and activate it on the options screen. On the other hand, if you just want to use your keyboard, check out the table below:

Key | Effect
--- | ---
Arrow keys | Move
Space bar | Jump
ENTER | Pause
Left CTRL key | Switch character (if team play)
PrintScreen or '=' | Screenshot
ESC | Quit

Tip: in order to change the controls, open config/input.def with a simple text editor (like notepad or gedit) and follow the instructions written in the file.

# Level Editor

During gameplay, press F12 to enter the level editor. Once you get in, you may press F1 to get further help. Our website features more detailed tutorials.

# MODs and Hacks

Open Surge™ is a highly flexible game, enabling users to hack it in a huge variety of forms. Modifications may range from small hacks to whole new games. You can learn all this cool stuff online.

# Troubleshooting

Banging your head against the wall? Please check out our online FAQ.

# Advanced features

## Command line options

The game provides several features via command line. Open a terminal and type:

    opensurge --help

## Game resources

You can store various forms of game media (levels, images, sounds and so on) in GAMEDIR/ (default) and also in $HOME/.opensurge/ (Linux only). GAMEDIR is, not surprisingly, the directory where the game is located. If you're a modder, this is for you.

# How to compile

## Overview

In order to build the game from the source code, you need a C language compiler and a few programming libraries. You also need CMake, a cross-platform open-source build system.

Let's define GAMEDIR as the directory where you unpacked the game. GAMEDIR stores, among other things, this readme.html page and a file called CMakeLists.txt

## Obtaining the libraries

Once your compiler is working properly, you'll need to install the following free programming libraries:

- Allegro 4.4.2, with (at least) the following addons:
  - JPGalleg
  - loadpng - requires: zlib and libpng
  - LOGG - requires: libogg and libvorbis
- Modified Alfont 2.0.9
- Linux user? You'll also need OpenAL and ALURE (with VorbisFile enabled)

In a regular installation of Allegro 4.4, JPGalleg and loadpng and LOGG are already included by default.

We won't get into details on how to install these libraries. Please check out their respective websites to know the detailed instructions.

## Compiling: GNU/Linux - gcc

Open a terminal, go to GAMEDIR and run the following commands:

    cmake .
    make
    sudo make install

To launch the game, type:

    opensurge

Note: if you find errors related to "allegro-config", we recommend that you compile Allegro from the source code.

## Compiling: Windows - MinGW

Are you a MinGW user? Make sure both lib\ and bin\ folders are listed on your PATH. You don't know? If MinGW is installed on C:\MinGW\, simply open a Command Prompt and type

    set PATH=%PATH%;C:\MinGW\bin;C:\MinGW\lib

On the same Command Prompt, please go to GAMEDIR and run the following commands:

    cmake -G "MinGW Makefiles" .
    mingw32-make

Note that little '.' at the end of the first command. If everything works well, opensurge.exe will be in GAMEDIR.

## Compiling: Mac OS X

We have no idea how to compile this on a Mac, but the instructions for Linux may give you some insight. ;)

## Other compilers/IDEs

Please open a terminal and run:

    cmake --help

CMake can generate all the data required by various compilers. It can also generate project files for popular IDEs like: Code::Blocks, Visual C++, KDevelop, etc.

# Credits

## License

Open Surge™ is free software!

The code of the engine is licensed under the GPL version 2 (or, at your option, any later version). The media attached to the game (graphics, sounds, levels, scripts, etc.) is mostly licensed under the Creative Commons Attribution-ShareAlike 3.0. Please check the credits screen and the licenses/ folder for more information.

## About this game

Open Surge™ is written from the ground up in C language, using the Allegro game programming library. It also uses LOGG for music playback, loadpng and JPGalleg for image loading/saving routines, alfont for True-Type font routines (which uses code from the FreeType project) and hqx for improved graphic rendering. OpenAL and ALURE may be optionally used for audio playback. This game was originally written by Alexandre Martins, a computer science student from Brazil. Nowadays, this project has several contributors all over the world! Game development is a such a beautiful and fascinating area, and one can learn a lot with it.

Thank you for reading.