Sphere (program)

From Wikipedia, the free encyclopedia

The Sphere 1.11 IDE.
The Sphere 1.11 IDE.

Sphere is a cross-platform, open source computer program designed primarily to make role-playing games (RPGs) similar to those found on the SNES and Sega Genesis consoles. Sphere was originally coded by Chad Austin. When making a game with Sphere, most things are scripted using the JavaScript (often abbreviated as JS) language (though very early versions used its own Spherescript language) with special functions and objects for maps, spritesets, images and other resources.

Though Sphere was designed to make RPGs, because of the flexibility of a scripting language it can be used to make almost any other type of game, even basic applications such as Drawing programs.

Sphere, unlike other game-makers who can create a single Executable file, keeps all of its files in folders, which involves many file-handling abilities. This is in tone with Sphere's Open Source ideology. It also has access to networking functions, allowing for gameplay over the internet or LANs.

Recent versions of Sphere also support basic 3D graphics functions using the OpenGL video driver. However, it is more complicated to use than the 2D graphics functions and is still in early stages.

Additionally, a modified version of Sphere was made where one could choose to use Python as the scripting language by changing a line of text in the "game.sgm" file. This feature was never completed and was not intended to be an official release, especially due to the conflict two incompatible scripting languages would make in the engine's community.

Contents

[edit] The Sphere Engine

Sphere has a wide range of basic abilities that are embedded in the engine itself and are run via scripts written in Javascript.

[edit] Drawing Functions

A great deal of drawing abilities are provided within the engine. These range far greater than the simple image, line, or shape drawing available in the majority of game engines. These functions allow game creators to create on-screen effects without tampering with image-editing software. As an added bonus, there is also a special image type called windowstyles which are images that can be stretched but keep their borders and corners intact - a tool used for displaying text boxes in games.

As for text, sphere allows users to import text from their operating system, and can also edit them within the IDE. A number of effects are available, such as applying gradients and expanding its size. The fonts themselves are not limited to the basic 256 characters, but can incorporate many more characters.

If any image files are used, they are saved in a folder within the game itself, which can be referred to from scripts.

Due to using JavaScript, highly complex and systematic functions, such as a Bézier curve are possible.

[edit] Programming With Sphere

Sphere uses the JavaScript language, used largely in the web. This means Sphere supports programming native objects, like strings, arrays, and objects, while retaining their native properties (like string.substr or array.length). This Object-oriented programming language allows Sphere to create highly adaptable objects and systems, producing powerful, structured and organized scripts.

The Sphere JS function Abort() is similar to Alert(), common for debugging JavaScript on the web.

Here is Hello World as used in Sphere:

function game(){
    Abort("Hello World");
}

[edit] External links