看板 GameDesign 關於我們 聯絡資訊
ebiten 套件原作者是日本人。 少量遊戲作品可在 wiki 中找到: https://github.com/hajimehoshi/ebiten/wiki/Works 很多使用範例可以學習: https://github.com/hajimehoshi/ebiten/tree/master/examples 0. 前人寫的中文教學: https://yami.io/tag/ebiten/ 在 Golang 透過 Ebiten(炸蝦)來製作 8-Bit 遊戲! 1. 安裝 git https://gitforwindows.org/ 2. 安裝 GO https://golang.org/ 3. 安裝 Android Studio https://developer.android.com/studio 我是裝在 c:\and 裝好後 Configure -> SDK -> SDK tools 找到 NDK 勾選它, 選 apply SDK 我是裝在 c:\andsdk NDK 在 c:\andsdk\ndk-bundle set ANDROID_NDK_HOME=c:\andsdk\ndk-bundle 或原始目錄 set ANDROID_NDK_HOME= \ C:\Users\username\AppData\Local\Android\Sdk\ndk-bundle 4. 安裝 gomobile https://godoc.org/golang.org/x/mobile/cmd/gomobile go get golang.org/x/mobile/cmd/gomobile gomobile init 5. 依照上面的中文說明取得 ebiten set ANDROID_NDK_HOME=c:\andsdk\ndk-bundle gomobile build -tags=example \ -target=android github.com/hajimehoshi/ebiten/examples/2048 得到 go2048.apk 安裝雷電可使用: https://imgur.com/QbC1uhd https://github.com/hajimehoshi/ebiten/wiki/Android https://github.com/hajimehoshi/ebiten/wiki/iOS https://github.com/hajimehoshi/ebiten/wiki/Mobile 6. WWW https://github.com/hajimehoshi/ebiten/wiki/GopherJS go get github.com/gopherjs/gopherjs gopherjs 不能用 -tags=example,原作者有設定 example 和系統分開 所以要 copy cd work xcopy /s C:\Users\username\go\src\github.com\hajimehoshi\ebiten\examples\2048 set GOOS=linux gopherjs build -o 2048.js main.go notepad 2048.htm <!DOCTYPE html> <script src="2048.js"></script> https://www.rejetto.com/hfs/ hfs.exe 2048.htm 2048.js hfs 會有網址 可用 chrome 開啟: https://imgur.com/w5for3v 7. PC 原版 go run -tags=example github.com/hajimehoshi/ebiten/examples/2048 https://imgur.com/zhfWiL4 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.129.22.24 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/GameDesign/M.1564026870.A.1F8.html
wangm4a1: 推 07/25 13:12
lanpadick: push 07/25 18:32
justatree: 推 07/25 20:17
aton602: 推 07/25 21:42
NX9999: 感謝,來試試看XD 07/26 01:56