README.md 4.37 KB
Newer Older
RobLoach's avatar
RobLoach committed
1
# ChaiLove :heart:
RobLoach's avatar
RobLoach committed
2
3
[![Travis](https://travis-ci.org/libretro/libretro-chailove.svg?branch=master)](https://travis-ci.org/libretro/libretro-chailove)
[![Appveyor](https://ci.appveyor.com/api/projects/status/es2wh45kcu76n6a9/branch/master?svg=true)](https://ci.appveyor.com/project/RobLoach/libretro-chailove/branch/master)
RobLoach's avatar
RobLoach committed
4
[![platform libretro](https://img.shields.io/badge/platform-libretro-brightgreen.svg)](http://buildbot.fiveforty.net/admin/buildbot/build/?name=chailove)
RobLoach's avatar
RobLoach committed
5
[![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](https://rawgit.com/libretro/libretro-chailove/docs/)
RobLoach's avatar
RobLoach committed
6

RobLoach's avatar
RobLoach committed
7
ChaiLove is an awesome framework you can use to make 2D games in [ChaiScript](http://chaiscript.com/). It's free, open-source, and works on Windows, Mac OS X, Linux, Android, and ARM through [libretro](https://www.libretro.com)/[RetroArch](http://retroarch.com).
RobLoach's avatar
RobLoach committed
8

RobLoach's avatar
RobLoach committed
9
[![Floppy Bird Gameplay](docs/screenshot.png)](https://www.youtube.com/watch?v=RLVwTh6qDFI&hd=1)
RobLoach's avatar
RobLoach committed
10

RobLoach's avatar
RobLoach committed
11
## Gallery
RobLoach's avatar
RobLoach committed
12

RobLoach's avatar
RobLoach committed
13
- [Floppy Bird](https://github.com/RobLoach/ChaiLove-FloppyBird)
14
- [Nyan Cat](https://github.com/RobLoach/ChaiLove-NyanCat)
RobLoach's avatar
RobLoach committed
15
- [Snake](examples/snake/Snake.chai)
16
- [Game of Life](https://github.com/RobLoach/ChaiLove-GameOfLife)
RobLoach's avatar
RobLoach committed
17
- [... and more](https://github.com/topics/chailove)
RobLoach's avatar
RobLoach committed
18

RobLoach's avatar
RobLoach committed
19
## Usage
RobLoach's avatar
RobLoach committed
20

RobLoach's avatar
RobLoach committed
21
ChaiLove is a [libretro](https://www.libretro.com/) core, which can be run through [RetroArch](http://retroarch.com/). [Floppy Bird](https://github.com/RobLoach/ChaiLove-FloppyBird) is a [free game you can download and play](https://www.youtube.com/watch?v=RLVwTh6qDFI)...
RobLoach's avatar
RobLoach committed
22

RobLoach's avatar
RobLoach committed
23
1. Run [RetroArch](http://retroarch.com/)
RobLoach's avatar
RobLoach committed
24
25
26
27
2. *Online Updater**Core Updator**ChaiLove*
3. *Online Updater**Content Downloader**ChaiLove**Floppy Bird*
4. *Load Content**Downloads**Floppy Bird.chailove*

RobLoach's avatar
RobLoach committed
28
Alternatively, you can run the ChaiLove core through RetroArch via the command line:
RobLoach's avatar
RobLoach committed
29

RobLoach's avatar
RobLoach committed
30
31
``` bash
curl -o FloppyBird.chailove https://github.com/RobLoach/ChaiLove-FloppyBird/releases/download/0.27.0/FloppyBird.chailove
RobLoach's avatar
RobLoach committed
32
retroarch -L chailove_libretro.so FloppyBird.chailove
RobLoach's avatar
RobLoach committed
33
```
RobLoach's avatar
RobLoach committed
34
35
36

## API

RobLoach's avatar
RobLoach committed
37
The [ChaiLove API](https://rawgit.com/libretro/libretro-chailove/docs/) is roughly inspired by the [LÖVE API](https://love2d.org/wiki/Main_Page). The following `main.chai` is a [simple Hello World example](examples/simple/main.chai):
RobLoach's avatar
RobLoach committed
38

RobLoach's avatar
RobLoach committed
39
``` lua
RobLoach's avatar
RobLoach committed
40
global logo
RobLoach's avatar
RobLoach committed
41
global x = 10.0f
RobLoach's avatar
RobLoach committed
42

RobLoach's avatar
RobLoach committed
43
def load() {
RobLoach's avatar
RobLoach committed
44
	logo = love.graphics.newImage("logo.png")
RobLoach's avatar
RobLoach committed
45
46
}

RobLoach's avatar
RobLoach committed
47
def draw() {
RobLoach's avatar
RobLoach committed
48
	love.graphics.print("Hello World!", 400, 300)
RobLoach's avatar
RobLoach committed
49
	love.graphics.draw(logo, x, 100)
RobLoach's avatar
RobLoach committed
50
}
RobLoach's avatar
RobLoach committed
51

RobLoach's avatar
RobLoach committed
52
53
def update(dt) {
	x = x + 20.0f * dt
RobLoach's avatar
RobLoach committed
54
}
RobLoach's avatar
RobLoach committed
55
```
RobLoach's avatar
RobLoach committed
56

RobLoach's avatar
RobLoach committed
57
58
To run it, execute the following:

RobLoach's avatar
RobLoach committed
59
``` bash
RobLoach's avatar
RobLoach committed
60
retroarch -L chailove_libretro.so main.chai
RobLoach's avatar
RobLoach committed
61
```
RobLoach's avatar
RobLoach committed
62

RobLoach's avatar
RobLoach committed
63
64
See the [ChaiLove API](https://rawgit.com/libretro/libretro-chailove/docs/) for coverage of all the callbacks and methods in ChaiLove.

RobLoach's avatar
RobLoach committed
65
66
## Development

RobLoach's avatar
RobLoach committed
67
The following are some notes about the development process behind ChaiLove.
RobLoach's avatar
RobLoach committed
68

RobLoach's avatar
RobLoach committed
69
70
### Compiling

RobLoach's avatar
RobLoach committed
71
ChaiLove requires a C++14 compiler, and has been tested with `g++>=5.2`. To compile it, run:
RobLoach's avatar
RobLoach committed
72
73

```
RobLoach's avatar
RobLoach committed
74
make
RobLoach's avatar
RobLoach committed
75
76
```

RobLoach's avatar
RobLoach committed
77
### Testing
RobLoach's avatar
RobLoach committed
78

RobLoach's avatar
RobLoach committed
79
The automated tests can be run with:
RobLoach's avatar
RobLoach committed
80
81
82
83
84

```
make test
```

RobLoach's avatar
RobLoach committed
85
Run the testing suite through RetroArch with:
RobLoach's avatar
RobLoach committed
86

RobLoach's avatar
RobLoach committed
87
```
RobLoach's avatar
RobLoach committed
88
retroarch -L chailove_libretro.so test/main.chai
RobLoach's avatar
RobLoach committed
89
90
```

RobLoach's avatar
RobLoach committed
91
92
### Documentation

RobLoach's avatar
RobLoach committed
93
See the [ChaiLove API documentation](https://rawgit.com/libretro/libretro-chailove/docs/). Build it through [Doxygen](http://www.stack.nl/~dimitri/doxygen/) by using:
RobLoach's avatar
RobLoach committed
94
95

```
RobLoach's avatar
RobLoach committed
96
make docs
RobLoach's avatar
RobLoach committed
97
```
RobLoach's avatar
RobLoach committed
98

RobLoach's avatar
RobLoach committed
99
100
### Workflow

RobLoach's avatar
RobLoach committed
101
ChaiLove uses modified [Gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) and [Semantic Versioning](https://semver.org) workflow...
RobLoach's avatar
RobLoach committed
102

RobLoach's avatar
RobLoach committed
103
104
105
106
1. New features and fixes are added to the [`dev`](https://github.com/libretro/libretro-chailove/tree/dev) branch
2. When a release is put out, the `dev` branch is merged to `master`, and a tag is made

## Contributors
RobLoach's avatar
RobLoach committed
107

RobLoach's avatar
RobLoach committed
108
The following individuals contributed to ChaiLove in some way:
RobLoach's avatar
RobLoach committed
109
110

- [@RobLoach](http://github.com/robloach)
RobLoach's avatar
RobLoach committed
111
112
113
114
115
116
117
- [@webgeek1234](http://github.com/webgeek1234) for the Android support
- [@r-type](https://github.com/r-type) for his work on [sdl-libretro](https://github.com/r-type/sdl-libretro)
- [@mudlord](https://github.com/mudlord) for his work on the [libretro-common](https://github.com/libretro/libretro-common) audio system
- [@orbea](http://github.com/orbea)
- [@fetzerch](http://github.com/fetzerch)
- [@bparker06](https://github.com/bparker06)
- [@twinaphex](http://github.com/twinaphex)
RobLoach's avatar
RobLoach committed
118
- [@ToKe79](https://github.com/ToKe79)
RobLoach's avatar
RobLoach committed
119
- [@baxysquare](https://github.com/baxysquare) for the [Logo](docs/chailove.png)