Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfcalvo/yoko
Yoko is a small framework to make games with ruby (mruby).
https://github.com/jfcalvo/yoko
c game mruby sdl sdl2
Last synced: about 1 month ago
JSON representation
Yoko is a small framework to make games with ruby (mruby).
- Host: GitHub
- URL: https://github.com/jfcalvo/yoko
- Owner: jfcalvo
- Created: 2015-03-18T23:40:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-28T16:42:25.000Z (over 8 years ago)
- Last Synced: 2024-12-23T18:04:09.606Z (about 2 months ago)
- Topics: c, game, mruby, sdl, sdl2
- Language: C
- Homepage:
- Size: 845 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Yoko](yoko.png)
**Yoko** is a small framework to make games with ruby. Yoko use mruby to allow your game be compiled for different platforms.
It is inspired by other frameworks like [LÖVE](http://www.love2d.org) but following another ideas and patterns.
# Warning
Yoko is in a very early stage of development (let's say that it's an alpha version) so we can't ensure that API will not change in the future.
# Examples
A simple example of how to show a rotating square on screen is the following:
```ruby
square = nilconfig do |conf|
conf.window.title = 'Rotating Square Example'
conf.window.width = 800
conf.window.height = 600
conf.window.fullscreen = :exclusive # :desktop, :exclusive or :windowed (default)
endload do
square = load_sprite('my_square_image.png')
square.x, square.y = 50, 50
endupdate do
square.angle += 2.0quit if key_pressed? :escape
enddraw do
square.draw
endquit do
puts 'Closing our rotating square example!'
endYoko.loop
```# Install
## Dependencies
First you need to have installed some Yoko dependencies:
- SDL2
- SDL2_ImageYou can easily install them with brew (on MacOS):
```sh
$ brew install sdl2 sdl2_image
```or with apt-get (on Debian-based distributions):
```
# apt-get install libsdl2-dev libsdl2-image-dev
```## Compilation
After install dependencies you can compile yoko:
```sh
$ make
```This will create some files under the `bin` directory, `yoko` interpreter and the interactive shell `iyoko`.
You can execute your game with `yoko`:
```sh
$ cd bin
$ ./yoko game.rb
```# API
TODO