- Sphere (program)
Sphere is a
cross-platform ,open source computer program designed primarily to makerole-playing game s (RPGs) similar to those found on the SNES andSega Genesis consoles. Sphere was originally coded byChad Austin . When making a game with Sphere, most things are scripted using theJavaScript (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 tune 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.
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.
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.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:External links
*http://sphere.sourceforge.net/ - Official Sphere Site
*http://www.spheredev.org/ - Dedicated Sphere community
*http://www.sphere-2d-engine.net/ - A French Sphere community
*http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference - Mozilla JavaScript Reference
*http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide - Mozilla JavaScript Guide
*http://www.spheredev.org/smforums/index.php?topic=592.0 - Forum page with Sphere Python documentation
Wikimedia Foundation. 2010.