Cleanup.
This commit is contained in:
4
game.go
4
game.go
@@ -368,7 +368,7 @@ func (g *Game) UpdateProjectiles() {
|
||||
func (g *Game) UpdateTargets() {
|
||||
for _, target := range g.targets {
|
||||
|
||||
if !target.Hit && g.hero.Action < MoverActionDying {
|
||||
if !target.Hit && g.hero.Action < HeroActionDying {
|
||||
dx := g.hero.Pos.X - target.Pos.X
|
||||
dy := g.hero.Pos.Y - target.Pos.Y
|
||||
angle := math.Atan2(dy, dx)
|
||||
@@ -380,7 +380,7 @@ func (g *Game) UpdateTargets() {
|
||||
}
|
||||
|
||||
//compute collision with hero
|
||||
if g.hero.Pos.X >= target.Pos.X-MOVER_WIDTH/2 && g.hero.Pos.X <= target.Pos.X+MOVER_WIDTH/2 && g.hero.Pos.Y >= target.Pos.Y-MOVER_HEIGHT/2 && g.hero.Pos.Y <= target.Pos.Y+MOVER_HEIGHT/2 && target.Action < MoverActionDying && g.hero.Action < MoverActionDying {
|
||||
if g.hero.Pos.X >= target.Pos.X-MOVER_WIDTH/2 && g.hero.Pos.X <= target.Pos.X+MOVER_WIDTH/2 && g.hero.Pos.Y >= target.Pos.Y-MOVER_HEIGHT/2 && g.hero.Pos.Y <= target.Pos.Y+MOVER_HEIGHT/2 && target.Action < MoverActionDying && g.hero.Action < HeroActionDying {
|
||||
g.heroCollisionMask.Clear()
|
||||
g.heroCollisionMask.DrawImage(g.hero.Sprite, nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user