Gemini SK provides Lua bindings to the Sprite Kit framework for iOS. This allows developers to write entire Sprite Kit games in Lua.
Gemini SK is an offshoot of the work done on the Gemini SDK. Rather than using custom OpenGL rendering of sprites and other graphics, it relies on Sprite Kit and follows the Sprite Kit APIs. This allows developers to work with a familar API in a high level scripting language.
While Gemini SK will eventually expose the entirety of the Sprite Kit APIs, for now bindings are availabile only for a subset. The following features are implemented to varying degrees at this time:
- Gemini provides high level graphics objects including sprites, sprite sheets, and geometric shapes based on bezier paths.
- Gemini SK provides scene management. Script each level of your game as a separate Lua module and control the order in which they get loaded directly in your Lua code via the Director API. Use any of the available Sprite Kit scene transitions.
- Gemini SK provides actions. Set up actions such as sprite animations, movement, rotations, etc. Use bezier paths to script complex motions. Actons can be combined to run in sequence or in parallel.
- Gemini SK provides physics. Bindings to the Box2D physics library allow you to add physics properties to any graphics object, including support for collision detection. Gemini SK does not use Sprite Kit physics directly due to limitations of that implementation. This feature is not yet imlemented.
- Gemini does sound. Simple sound effects are supported through bindings to
SKAction playSoundFileNamed:
. More sophisticated control will be made available through bindings to the Open AL framework. - Gemini SK provides an event API. Register objects for touch events, collision events, or other events. Set up timer events (one-shot or recurring) to call your Lua code periodically. Regiser Lua code as callbacks for events like the beginning of the render loop.
- It's easy to get started. Just drop the Xcode project templates in your template folder and you're ready to go.
The zip file containing the templates can be found here. Unzip it and copy the contents of the gemini_sk_templates directory into ~/Library/Developer/Xcode/Templates/Gemini/ then restart Xcode. You should now be able to choose a Gemini project when you choose File->New->Project in Xcode.
Check out the project page or go directly to the Lua API docs. Also check out the Wiki for guides and examples.
Contributions to Gemini SK are welcome, whether it's a bug report, feature suggestion, or a pull request. Gemini SK is very much a work in progress and I am focusing on core features first to get it production ready as soon as possible.
(The MIT License)
Copyright (c) 2013-2014 James Norton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Credit Gemini SK in any apps you build with it.
- Add your app to the app list in the Wiki so we can watch the community grow.