Bullet hell video game
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.

31 lines
703 B

package entity
import (
"code.rocketnine.space/tslocum/brownboxbatman/asset"
"code.rocketnine.space/tslocum/brownboxbatman/component"
. "code.rocketnine.space/tslocum/brownboxbatman/ecs"
"code.rocketnine.space/tslocum/gohan"
)
func NewPlayer() gohan.Entity {
player := ECS.NewEntity()
ECS.AddComponent(player, &component.PositionComponent{})
ECS.AddComponent(player, &component.VelocityComponent{})
weapon := &component.WeaponComponent{
Damage: 1,
FireRate: 144 / 16,
BulletSpeed: 8,
}
ECS.AddComponent(player, weapon)
ECS.AddComponent(player, &component.SpriteComponent{
Image: asset.ImgBat,
})
ECS.AddComponent(player, &component.RailComponent{})
return player
}