parent
d6caa67781
commit
945186bd28
11
README.md
11
README.md
|
@ -4,9 +4,7 @@
|
|||
[](https://liberapay.com/rocketnine.space)
|
||||
|
||||
[Entity component system](https://en.wikipedia.org/wiki/Entity_component_system) framework
|
||||
for [Ebiten](https://ebiten.org)
|
||||
|
||||
**Note:** This framework is still in development. Breaking changes may be made until v1.0 is released.
|
||||
for [Ebitengine](https://ebiten.org)
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -21,9 +19,12 @@ Please share issues and suggestions [here](https://code.rocketnine.space/tslocum
|
|||
|
||||
## List of games powered by Gohan
|
||||
|
||||
- **Brown Box Bat Man** is a bullet hell game.
|
||||
- **Fish Fight Back**
|
||||
- [Play game](https://rocketnine.itch.io/fishfightback)
|
||||
- [View source code](https://code.rocketnine.space/tslocum/fishfightback)
|
||||
- **Brown Box Bat Man**
|
||||
- [Play game](https://rocketnine.itch.io/brownboxbatman)
|
||||
- [View source code](https://code.rocketnine.space/tslocum/brownboxbatman)
|
||||
- **Monovania** is a Metroidvania-style platform game.
|
||||
- **Monovania**
|
||||
- [Play game](https://rocketnine.itch.io/monovania)
|
||||
- [View source code](https://code.rocketnine.space/tslocum/monovania)
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package gohan
|
||||
|
||||
// context represents the current iteration of a System's matching entities.
|
||||
type context struct {
|
||||
allowed []componentID
|
||||
components []interface{}
|
||||
systemIndex int
|
||||
}
|
11
doc.go
11
doc.go
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package gohan provides an Entity Component System framework for Ebiten.
|
||||
Package gohan provides an Entity Component System framework for Ebitengine.
|
||||
|
||||
An example game is available at /examples/twinstick, which may be built by
|
||||
executing the following command (in /examples/twinstick):
|
||||
|
@ -27,7 +27,9 @@ each systems' set of required matching components.
|
|||
type ExampleSystem struct {
|
||||
Position *component.PositionComponent // Required component.
|
||||
Velocity *component.VelocityComponent // Required component.
|
||||
|
||||
Sprite *component.SpriteComponent `gohan:"?"` // Optional component.
|
||||
|
||||
Enabled bool `gohan:"-"` // Not a component.
|
||||
}
|
||||
|
||||
|
@ -51,11 +53,6 @@ call, or else the application will encounter race conditions.
|
|||
Environment Variables
|
||||
|
||||
Running an application with the environment variable GOHAN_DEBUG set to 1
|
||||
enables verification of systems' access to components. This verification is
|
||||
disabled by default for performance reasons. While verification is enabled,
|
||||
if a system attempts to access a component which is not included in the
|
||||
system's Needs or Uses, the application will panic and print information about
|
||||
the illegal component access. Setting GOHAN_DEBUG to 1 will also enable
|
||||
printing system registration events and statistics.
|
||||
will enable printing verbose system update and draw information.
|
||||
*/
|
||||
package gohan
|
||||
|
|
|
@ -24,7 +24,5 @@ archives:
|
|||
format: zip
|
||||
- goos: windows
|
||||
format: zip
|
||||
# files:
|
||||
# - src: '../../*.md'
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
// method returning the error should not be called again.
|
||||
//
|
||||
// Systems do not need to implement locking to prevent race conditions between
|
||||
// Update and Draw methods. Ebiten calls only one of these methods at a time.
|
||||
// Update and Draw methods. Ebitengine calls only one of these methods at a time.
|
||||
type System interface {
|
||||
// Update is called once for each matching Entity each time the game state is updated.
|
||||
Update(e Entity) error
|
||||
|
|
Loading…
Reference in New Issue