Entity Component System framework for Ebitengine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
787 B

//go:build example
// +build example
package entity
import (
func NewPlayer() gohan.EntityID {
player := gohan.NextEntityID()
// Set position to -1,-1 to indicate the player has not been assigned a
// position yet. We will place the player in the center of the screen when
// we receive the screen dimensions for the first time.
X: -1,
Y: -1,
weapon := &component.WeaponComponent{
Ammo: math.MaxInt64,
Damage: 1,
FireRate: 100 * time.Millisecond,
BulletSpeed: 15,
return player