Documentation
¶
Index ¶
- Constants
- Variables
- type Game
- func (g *Game) APIToken() string
- func (g *Game) APIURL() string
- func (g *Game) AddImage(img *Image)
- func (g *Game) AddObject(obj *Object)
- func (g *Game) AddSubject(sub *Object)
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) H() int
- func (g *Game) ID() string
- func (g *Game) Layout(w, h int) (int, int)
- func (g *Game) Load() (rErr error)
- func (g *Game) MarshalJSON() ([]byte, error)
- func (g *Game) Name() string
- func (g *Game) Run(ctx context.Context) error
- func (g *Game) Save() (rErr error)
- func (g *Game) SetAPIToken(apiToken string)
- func (g *Game) SetAPIURL(apiURL string)
- func (g *Game) SetH(h int)
- func (g *Game) SetID(id string)
- func (g *Game) SetName(name string)
- func (g *Game) SetScript(src string)
- func (g *Game) SetW(w int)
- func (g *Game) UnmarshalJSON(data []byte) error
- func (g *Game) Update() error
- func (g *Game) W() int
- type Image
- type Object
- func (o *Object) Draw(screen *ebiten.Image)
- func (o *Object) Layout(w, h int) (int, int)
- func (o *Object) Map() map[string]any
- func (o *Object) MarshalJSON() ([]byte, error)
- func (o *Object) SetData(data map[string]any)
- func (o *Object) SetH(h int)
- func (o *Object) SetHidden(hidden bool)
- func (o *Object) SetImage(img string)
- func (o *Object) SetName(name string)
- func (o *Object) SetR(r int)
- func (o *Object) SetW(w int)
- func (o *Object) SetX(x int)
- func (o *Object) SetY(y int)
- func (o *Object) SetZ(z int)
- func (o *Object) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( DefaultGameWidth = 640 DefaultGameHeight = 480 )
Game defaults.
Variables ¶
View Source
var Version = ""
The client version.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game values represent the game state.
func (*Game) AddSubject ¶
AddSubject adds a subject to the game.
func (*Game) MarshalJSON ¶
MarshalJSON serializes the game to JSON.
func (*Game) SetAPIToken ¶
SetAPIToken sets the API token.
func (*Game) UnmarshalJSON ¶
UnmarshalJSON deserializes the game from JSON.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image values represent the images in the game.
func (*Image) MarshalJSON ¶
MarshalJSON serializes the image to JSON.
func (*Image) UnmarshalJSON ¶
UnmarshalJSON deserializes the image from JSON.
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object values represent the objects in the game.
func NewObjectFromMap ¶
NewObjectFromMap creates a new object from a map.
func NewSubject ¶
NewSubject creates and initializes a new subject object.
func (*Object) MarshalJSON ¶
MarshalJSON serializes the object to JSON.
func (*Object) UnmarshalJSON ¶
UnmarshalJSON deserializes the object from JSON.
Click to show internal directories.
Click to hide internal directories.