Skip to content

v1.0.2

Latest
Compare
Choose a tag to compare
@setanarut setanarut released this 03 Nov 13:57

[v1.0.2] Change Log

  • The ping pong feature was extracted as the MakePingPong() method.
  • Refactoring
  • Update go.mod

Added

// MakePingPong arranges the animation indexes to play back and forth.
// [0 1 2 3] -> [0 1 2 3 2 1]
func MakePingPong(frames []*ebiten.Image) []*ebiten.Image {
	for i := len(frames) - 2; i > 0; i-- {
		frames = append(frames, frames[i])
	}
	return frames
}