24 lines
458 B
Go
24 lines
458 B
Go
package entity
|
|
|
|
import (
|
|
"code.rocketnine.space/tslocum/doctorlectro/asset"
|
|
"code.rocketnine.space/tslocum/doctorlectro/component"
|
|
"code.rocketnine.space/tslocum/gohan"
|
|
)
|
|
|
|
func NewBullet() gohan.Entity {
|
|
bullet := gohan.NewEntity()
|
|
|
|
bullet.AddComponent(&component.Position{})
|
|
|
|
bullet.AddComponent(&component.Velocity{})
|
|
|
|
bullet.AddComponent(&component.Bullet{})
|
|
|
|
bullet.AddComponent(&component.Sprite{
|
|
Image: asset.ImgBullet,
|
|
})
|
|
|
|
return bullet
|
|
}
|