ebiten/readme.md

91 lines
1.9 KiB
Markdown
Raw Normal View History

2014-12-29 15:16:02 +01:00
# Ebiten (海老天)
2014-10-12 06:09:19 +02:00
2014-12-28 14:27:07 +01:00
[![Build Status](https://travis-ci.org/hajimehoshi/ebiten.svg?branch=master)](https://travis-ci.org/hajimehoshi/ebiten)
2014-12-28 09:09:50 +01:00
* A simple SNES-like 2D game library in Go
2014-12-26 14:20:53 +01:00
* Works on
* Web browsers (powered by [GopherJS](http://gopherjs.org/))
2014-12-26 14:20:53 +01:00
* Mac OS X
* Linux (maybe)
* Windows (possibly)
2014-12-22 20:46:58 +01:00
* [API Docs](http://godoc.org/github.com/hajimehoshi/ebiten)
2014-10-12 06:09:19 +02:00
2014-12-24 02:00:09 +01:00
## Features
2014-10-12 06:09:19 +02:00
2014-12-24 02:00:09 +01:00
* 2D Graphics
* Input (Mouse, Keyboard)
## Example
2014-12-29 10:43:35 +01:00
* example/blocks - Puzzle game you know
2014-12-28 07:09:40 +01:00
* example/hue - Changes the hue of an image
2014-12-24 02:00:09 +01:00
* example/mosaic - Mosaics an image
* example/perspective - See an image in a perspective view
* example/rotate - Rotates an image
* etc.
2014-10-12 06:09:19 +02:00
2014-12-22 20:46:58 +01:00
## Install on Mac OS X
2014-12-05 19:14:03 +01:00
```
:; brew install glew
2014-12-11 12:03:08 +01:00
:; brew install glfw3 # or homebrew/versions/glfw3
2014-12-05 19:14:03 +01:00
:; go get -u github.com/hajimehoshi/ebiten
```
2015-01-02 17:24:32 +01:00
If you want to use GopherJS, execute this:
```
:; go get -u -tag=js github.com/hajimehoshi/ebiten
```
2014-12-22 20:46:58 +01:00
## Execute the example
2014-10-12 07:07:44 +02:00
2014-12-05 11:50:04 +01:00
```
:; cd $GOPATH/src/github.com/hajimehoshi/ebiten/example
:; go run blocks/main.go
2014-12-05 11:50:04 +01:00
```
2014-10-12 07:07:44 +02:00
## Execute the example on a web browser
```
:; go get github.com/gopherjs/gopherjs
:; go run $GOPATH/src/github.com/hajimehoshi/ebiten/example/server/main.go
```
Then, open ``localhost:8000`` on your browser.
``localhost:8000/?EXAMPLE_NAME`` shows other examples (e.g. ``localhost:8000/?rotate``).
## Run your game on a web browser
Compile your game with GopherJS:
```
:; go get github.com/gopherjs/gopherjs
:; gopherjs build -o yourgame.js path/to/yourgame
```
Then, open the below HTML on your HTTP server:
```html
<!DOCTYPE html>
<script src="yourgame.js"></script>
```
2014-12-22 20:46:58 +01:00
### Benchmark the example
2014-12-06 22:03:13 +01:00
```
:; cd $GOPATH/src/github.com/hajimehoshi/ebiten/example
2014-12-14 15:15:18 +01:00
:; go build -o=example blocks/main.go
2014-12-06 22:03:13 +01:00
:; ./example -cpuprofile=cpu.out
:; go tool pprof ./example cpu.out
```
2014-12-27 15:27:37 +01:00
## Versioning
2015-01-05 16:44:39 +01:00
* We obey [Semantic Versioning](http://semver.org/) basically.
2014-12-27 15:27:37 +01:00
2014-10-12 06:09:19 +02:00
## License
2014-12-29 15:16:02 +01:00
See license.txt.