Entity Component System framework for Ebiten
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
781 B

//go:build example
// +build example
package entity
import (
func NewPlayer() gohan.Entity {
player := gohan.NewEntity()
// 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