Spawning radi

This commit is contained in:
2025-09-21 08:24:28 +02:00
parent e8d99dd002
commit 0e89b8be70
3 changed files with 63 additions and 43 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/hajimehoshi/ebiten/v2"
"gitlab.com/kbr4/9heroja/collision"
"gitlab.com/kbr4/9heroja/resources"
"gitlab.com/kbr4/9heroja/zombie"
)
var (
@@ -75,3 +76,13 @@ func (s *Starting) HandleCollisionEvent(other collision.Collidable) {
fmt.Println("Starting hit by zombie")
}
}
func (s *Starting) SpawnZombie(whereToGoX, whereToGoY float64) *zombie.Zombie {
z := zombie.NewZombie()
z.X = s.X
z.Y = s.Y
z.WhereToGoX = whereToGoX
z.WhereToGoY = whereToGoY
z.Walk()
return z
}