You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
396 B
Go
23 lines
396 B
Go
package entity
|
|
|
|
import (
|
|
"code.rocketnine.space/tslocum/citylimits/component"
|
|
"code.rocketnine.space/tslocum/gohan"
|
|
)
|
|
|
|
func NewPlayer() gohan.Entity {
|
|
player := gohan.NewEntity()
|
|
|
|
player.AddComponent(&component.Position{})
|
|
|
|
player.AddComponent(&component.Velocity{})
|
|
|
|
player.AddComponent(&component.Weapon{
|
|
Damage: 1,
|
|
FireRate: 144 / 16,
|
|
BulletSpeed: 8,
|
|
})
|
|
|
|
return player
|
|
}
|