citylimits/entity/player.go

23 lines
396 B
Go
Raw Normal View History

2022-01-09 17:10:40 +00:00
package entity
import (
"code.rocketnine.space/tslocum/citylimits/component"
"code.rocketnine.space/tslocum/gohan"
)
func NewPlayer() gohan.Entity {
player := gohan.NewEntity()
2022-01-09 17:10:40 +00:00
player.AddComponent(&component.Position{})
2022-01-09 17:10:40 +00:00
player.AddComponent(&component.Velocity{})
2022-01-09 17:10:40 +00:00
player.AddComponent(&component.Weapon{
2022-01-09 17:10:40 +00:00
Damage: 1,
FireRate: 144 / 16,
BulletSpeed: 8,
})
2022-01-09 17:10:40 +00:00
return player
}