mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Updated Installation (markdown)
parent
f828ebb12c
commit
46f8fbacd1
@ -1,62 +1 @@
|
||||
# Install
|
||||
|
||||
Let's get the Ebiten source code and compile it.
|
||||
|
||||
```sh
|
||||
go get github.com/hajimehoshi/ebiten/...
|
||||
```
|
||||
|
||||
If you want to run your game on a web browser, execute this:
|
||||
|
||||
```sh
|
||||
go get github.com/gopherjs/gopherjs
|
||||
go get github.com/gopherjs/gopherwasm/js
|
||||
```
|
||||
|
||||
# Modules
|
||||
|
||||
As of Go 1.11, modules are introduced. You can work with Ebiten without GOPATH environment variable. If you want to use Ebiten with modules, execute these commands with Go 1.11:
|
||||
|
||||
```sh
|
||||
# Write your game at your favorite directory.
|
||||
cd yourgame
|
||||
# ...
|
||||
|
||||
# Initialize go.mod by `go mod`.
|
||||
# Use URL for your package like `github.com/yourname/yourgame`.
|
||||
# If you are not sure and don't plan to share it so far, `example.com/m` is fine.
|
||||
go mod init example.com/m
|
||||
|
||||
# Run your game.
|
||||
# `go run` installs related libraries automatically.
|
||||
go run .
|
||||
```
|
||||
|
||||
# Run examples
|
||||
|
||||
Let's execute an example to check installation finished correctly.
|
||||
|
||||
## Without modules
|
||||
|
||||
On POSIX:
|
||||
|
||||
```
|
||||
cd $HOME/go/src/github.com/hajimehoshi/ebiten
|
||||
go run -tags=example ./examples/rotate
|
||||
```
|
||||
|
||||
On Windows:
|
||||
|
||||
```
|
||||
cd %HOME%\go\src\github.com\hajimehoshi\ebiten
|
||||
go run -tags=example ./examples/rotate
|
||||
```
|
||||
|
||||
## With modules
|
||||
|
||||
```
|
||||
mkdir test
|
||||
go mod init example.com/m
|
||||
go get github.com/hajimehoshi/ebiten
|
||||
go run -tags=example github.com/hajimehoshi/ebiten/rotate
|
||||
```
|
||||
See https://ebiten.org/install.html.
|
Loading…
Reference in New Issue
Block a user