gohan/doc.go

40 lines
1.4 KiB
Go
Raw Normal View History

2021-11-19 04:13:28 +00:00
/*
Package gohan provides an Entity Component System framework for Ebiten.
An example game is available at /examples/twinstick which may be built by
executing the following command (in /examples/twinstick):
go build -tags example .
Entity
A general-purpose object, which consists of a unique ID, starting with 1.
Component
The raw data for one aspect of an object, and how it interacts with the world.
Each component is assigned a unique ID, starting with 1.
System
Each system runs continuously, performing actions on every Entity that fits
each systems' set of required matching components.
Component Design Guidelines
Components are located in a separate package, typically named component. They
should be public (start with an uppercase letter) and may have any number of
publicly accessible data fields. They should not have any logic (i.e. game code)
within them, as all logic should be implemented within a System.
System Design Guidelines
Systems are located in a separate package, typically named system. They should
be private (start with a lowercase letter) and offer an instantiation function
named as follows: NewSystemNameHere(). Data should be stored within components
attached to one or more entities, rather than within the systems themselves.
References to components must not be maintained outside each Update and Draw
call, or else the application will encounter race conditions.
2021-11-19 04:13:28 +00:00
*/
package gohan