Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.

License

NotificationsYou must be signed in to change notification settings

spheredev/neosphere

Repository files navigation

Release

neoSphere is a lightweight, fully sandboxed, JavaScript-powered gameengine and development platform. It is a complete rewrite of Chad Austin'soriginalSphere engine, written from the ground up in C. While neoSphere isbackwards compatible with the original engine (henceforth referred to asSphere 1.x), it also brings with it a new, modern API and a collection ofpowerful development tools.

Graphics and audio support are provided throughAllegro 5, and JavaScript support is enabled byChakraCore, the same JavaScriptengine that once powered Microsoft Edge.

Download

The latest release of neoSphere, complete with development tools, can always befound on the neoSphere releases page:

For an overview of the breaking changes in each release, refer toRELEASES.md.

The Sphere Toolbox

Sphere games are written in JavaScript, which gives game developers a greatdeal of power. The API is designed to be user-friendly and reasonablyaccessible to novices, allowing coders of any skill level to pick up the engineand start hacking away.

The Game Engine

The official Sphere engine implementation for desktop platforms is known asneoSphere. There is also a Web-based version, currently in development,known asOozaru, which has its own GitHub repository but is planned toeventually be merged into the main repository.

Sphere games are written in JavaScript. The engine exposes a collection oflow-level functions to the JavaScript environment, leaving higher-level gamelogic entirely up to script. In this way, any kind of game can be developedand you are not limited to a specific genre as in, for example, RPG Maker.

Besides the low-level Core API, there is also a set of libraries written inJavaScript that any game is free to use, collectively called theSphere Runtime. The Runtime provides high-level functionality such as atext-based debug console and music manager, which can save a lot of time whendeveloping new games.

The Compiler

Cell, the Sphere compiler, uses JavaScript to control the build process.Like neoSphere, Cell is powered by ChakraCore and natively supports ES2015features like arrow functions, destructuring, and modules. A basic Cellscriptmight look like this:

/* Cellscript.js */describe({version:2,// target the Sphere v2 APIapiLevel:3,// require API level 3+name:"My Game",author:"Some Guy",summary:"This game is awesome.",resolution:'768x480',main:'scripts/main.js',});// install JavaScript modulesinstall('@/scripts',files('scripts/*.js',true));// install non-code game assetsinstall('@/images',files('images/*.png',true));install('@/music',files('music/*.ogg',true));install('@/sounds',files('sounds/*.wav',true));install('@/',files('icon.png'));

If that's not enough for you, then using Cell's flexibleTool API, you canextend the compiler to build any kind of asset. Simply construct aToolobject and provide a function to be called when the tool is executed. The toolbelow will write the contents of a single text file to the destination file:

// the second argument to `new Tool()` is optional and describes the process// performed by the tool, e.g., "compiling" or "installing".  if omitted, Cell// just says "building".letcopyTool=newTool((outName,sourceNames)=>{lettext=FS.readFile(sourceNames[0]);FS.writeFile(outName,text);},"copying");

To have Cell build a file using your new tool, just do this:

// the first argument is the destination filename, the second argument is an// array of Target objects specifying the sources.  Here we pass an exact// filename to files() to get that array.//// note: the prefix '@/' refers to the root of the game package being compiled.//       see `cellscript-api.txt` for more information on SphereFS prefixes.copyTool.stage('@/eatypig.fat',files('eaty/pig.src'));

The Debugger

SSj, the Sphere debugger, is an easy-to-use command-line debugger forSphere games. SSj works in tandem with neoSphere to allow you to step throughyour game's code and inspect the internal state of the code--variables, callstack, objects, etc.--while it executes. Best of all, the original sourcefiles don't need to be present: SSj can download source code directly from theengine instance being debugged.

A symbolic debugger like SSj is an invaluable tool for development and is aneoSphere exclusive: no such tool was ever available for the original engine!

License

The entire Sphere game development platform is licensed under the terms of theBSD-3-clause license. Practically speaking, this means the engine and toolscan be used for any purpose, even commercially, with no restriction other thanmaintain the original copyright notice.

About

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp