Pgfsm
The state and stack machine library for the game programming using Ebiten
Install / Use
/learn @PenguinCabinet/PgfsmREADME
The Pen Game Programing Finite State Machine
これはGoのゲームライブラリEbiten用のステートマシンライブラリです。
提供する機能
- ゲームプログラミングのためのスタック型のステートマシン
ドキュメント
採用実績
絶賛募集中です。
このライブラリを採用しているゲームで載せてもいいよという方は是非Issueで教えてください。
Quick start
インストール
go get github.com/PenguinCabinet/pgfsm
Example
package main
import (
"log"
"github.com/PenguinCabinet/pgfsm"
"github.com/hajimehoshi/ebiten/v2"
)
type MyGameState struct {
}
func (sm *MyGameState) Init(
stackdeep int, /*The index of this state.*/
) {
//Init
}
func (sm *MyGameState) Update(
stackdeep int,
) pgfsm.Result {
//Update
return pgfsm.Result{
Code: pgfsm.CodeNil,
NextState: nil,
}
}
func (sm *MyGameState) Draw(screen *ebiten.Image, stackdeep int) {
//Draw
}
func main() {
ebiten.SetWindowSize(640, 480)
ebiten.SetWindowTitle("game title")
gms := &pgfsm.Machine{}
gms.LayoutWidth = 640
gms.LayoutHeight = 480
mySm := &MyGameState{}
gms.StateAdd(mySm)
if err := ebiten.RunGame(gms); err != nil {
log.Fatal(err)
}
}
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
345.9kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
