Compare commits
2 Commits
87e40226c7
...
0648ed3658
| Author | SHA1 | Date | |
|---|---|---|---|
| 0648ed3658 | |||
| 1897114236 |
9
hero.go
9
hero.go
@@ -109,11 +109,9 @@ func (m *Hero) Draw() {
|
||||
case HeroActionDefault:
|
||||
m.Sprite.DrawImage(heroImage.SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), nil)
|
||||
case HeroActionDying:
|
||||
m.dyingcount++
|
||||
|
||||
m.Sprite.DrawImage(heroDeath.SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), nil)
|
||||
|
||||
if m.dyingcount > 60 {
|
||||
if m.dyingcount >= 31 {
|
||||
m.cycles = 0
|
||||
m.Action++
|
||||
}
|
||||
@@ -124,12 +122,17 @@ func (m *Hero) Draw() {
|
||||
}
|
||||
|
||||
func (m *Hero) Update() {
|
||||
|
||||
if m.Action == HeroActionDying {
|
||||
m.dyingcount++
|
||||
}
|
||||
m.cycles++
|
||||
}
|
||||
|
||||
// one hit death for the hero
|
||||
func (m *Hero) SetHit() {
|
||||
m.Action = MoverActionDying
|
||||
m.dyingcount = 0
|
||||
m.Angle = 0
|
||||
m.cycles = 0
|
||||
}
|
||||
|
||||
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