Decoupled death animation from draw thread.
This commit is contained in:
7
mover.go
7
mover.go
@@ -134,7 +134,7 @@ func (m *Mover) Draw() {
|
||||
m.Sprite.DrawImage(shadow, op)
|
||||
m.Sprite.DrawImage(flyeyeImage2.SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), nil)
|
||||
case MoverActionDying:
|
||||
m.dyingcount++
|
||||
|
||||
if (m.cycles/5)%2 == 0 {
|
||||
|
||||
m.MaksDest.DrawImage(flyeyeImage2.SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), nil)
|
||||
@@ -147,7 +147,7 @@ func (m *Mover) Draw() {
|
||||
} else {
|
||||
m.Sprite.DrawImage(flyeyeImage2.SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), nil)
|
||||
}
|
||||
if m.dyingcount > 60 {
|
||||
if m.dyingcount >= 31 {
|
||||
m.cycles = 0
|
||||
m.SetHit()
|
||||
}
|
||||
@@ -172,6 +172,9 @@ func (m *Mover) Update() {
|
||||
m.Angle = float64(m.cycles) / (math.Pi * 2)
|
||||
}
|
||||
*/
|
||||
if m.Action == MoverActionDying {
|
||||
m.dyingcount++
|
||||
}
|
||||
m.cycles++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user