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 {
|
2022-07-19 20:10:37 +00:00
|
|
|
player := gohan.NewEntity()
|
2022-01-09 17:10:40 +00:00
|
|
|
|
2022-07-19 20:10:37 +00:00
|
|
|
player.AddComponent(&component.Position{})
|
2022-01-09 17:10:40 +00:00
|
|
|
|
2022-07-19 20:10:37 +00:00
|
|
|
player.AddComponent(&component.Velocity{})
|
2022-01-09 17:10:40 +00:00
|
|
|
|
2022-07-19 20:10:37 +00:00
|
|
|
player.AddComponent(&component.Weapon{
|
2022-01-09 17:10:40 +00:00
|
|
|
Damage: 1,
|
|
|
|
FireRate: 144 / 16,
|
|
|
|
BulletSpeed: 8,
|
2022-07-19 20:10:37 +00:00
|
|
|
})
|
2022-01-09 17:10:40 +00:00
|
|
|
|
|
|
|
return player
|
|
|
|
}
|