mirror of
https://github.com/libretro/libretro-chailove.git
synced 2024-11-30 03:30:26 +00:00
❤️ 2D Game Framework with ChaiScript
examples | ||
src | ||
test | ||
vendor | ||
.editorconfig | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
chailove_libretro.info | ||
configure | ||
LICENSE.md | ||
link.T | ||
main.chai | ||
Makefile | ||
Makefile.common | ||
Makefile.libretro | ||
README.md |
ChaiLove
Framework to make 2D games with ChaiScript and libretro/RetroArch.
Games
Usage
ChaiLove is a libretro core, which can be run through RetroArch. To play Floppy Bird, run RetroArch and...
- Run RetroArch
- Download the ChaiLove core through RetroArch at Online Updater → Core Updator → ChaiLove
- Download Floppy Bird through RetroArch at Online Updater → Content Downloader → ChaiLove → Floppy Bird
- Launch the game over through Load Content → Downloads → Floppy Bird.chailove
API
ChaiLove is roughly inspired by the LÖVE API. The following main.chai
is a simple Hello World sample application:
global logo
def load() {
logo = graphics.newImage("logo.png")
}
def draw() {
graphics.print("Hello World!", 400, 300)
graphics.draw(logo, 100, 100)
}
def update(delta) {
// Change something on the screen.
}
To run it, execute the following:
retroarch -L chailove_libretro.so main.chai
Development
Building ChaiLove takes some time, so have patience. Use the following command to compile the core:
make
Testing
To compile and run the testing framework, use:
make examples
Flags
There are a few flags you can enable to change how Chai is compiled and used.
HAVE_CHAISCRIPT=0
Remove the scripting environment for fast compilationHAVE_TESTS=1
Enablestest/Test.cpp
for testing
make HAVE_CHAISCRIPT=0 HAVE_TESTS=1