Skip to content

NNNIC/psgg-go-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psgg-go-sample

I'd like to introduce how to use StateGo with Go programming language.

Environment

Windows10
StateGo

Golang environment
ebiten (if you use ebiten framework.)

Folder Tree

--/  
  |   
  +- ebiten  : StateGo samples for 2D Framework Ebiten   
  |   
  +- general : a StateGo sample for general purposes.   
  |  
  +- test    : "try and error" tests to research.  
  |  
  +- test-ebiten : "try and error" ebiten tests to research.  
  |  
  +- wiki    :  etc.  
 

A sample for general purposes.

Folder /general
Open testControl.psgg using StateGo.
Without or with any framework, you may use this state machine as the template.

State Chart

Run

Open cmd.exe then type ...
go run testControl.go

ebiten samples

Folder /ebiten

ebiten is a 2d game library.
I created a sample framework to copolate with ebiten library.

Draw apis must be called at draw function in "ebiten framework". So, I prepared drawlists for pushing draw apis at update timing. Then call drawlist at "ebiten's draw timing".

sample #1

Folder /ebiten/sample1

mainCtonrol has a menu and five features. Four features are implementing simple features and ebiten's example.
The one feature is for calling general StateGo Control introduced above this section.

State Chart

mainControl

testControl (as is genaral's one)

Run

Sample #2

This sample only differs testControl from ''sample #1''

State Chart

testControl

Playground

Folder /ebiten/playground

This sample does not have testControl.
You may create and put testControl into this sample.

Gophers love ebiten

Folder /ebiten/gopherslove

This a sample game using ebiten and StateGo.

Go Gopher by Renee French is licensed under the Creative Commons Attribution 3.0 License.

Webasembly version

You can play it.