func (lc *LerpPosition) Init(start time.Time, startPosition *Vector, endPosition *Vector, duration time.Duration, isEnabled bool, endFunc func(), isDestroyedAtEnd bool) {
	lc.start = time.Now()
	lc.startPosition = startPosition
	lc.endPosition = endPosition
	lc.duration = duration
	lc.isEnabled = true
	lc.endFunc = endFunc
	lc.isDestroyed = isDestroyedAtEnd
}
Init sets up a new lerp
package common
import (
	"time"
)
type LerpPosition struct {
	start         time.Time
	startPosition *Vector
	duration      time.Duration
	endPosition   *Vector
	endFunc       func()
	isEndFuncSet  bool
	isDestroyed   bool
	isEnabled     bool
}
func (lc *LerpPosition) Lerp() (x float64, y float64) {
	if !lc.isEnabled {
		return lc.endPosition.X, lc.endPosition.Y
	}
	if lc.start.Add(lc.duration).Before(time.Now()) {
		lc.isEnabled = false
		return lc.endPosition.X, lc.endPosition.Y
	}
	elapsed := time.Since(lc.start).Nanoseconds()
	destNano := lc.start.Add(lc.duration).Sub(lc.start).Nanoseconds()
	t := float64(float64(elapsed) / float64(destNano))
	x = (1-t)*lc.startPosition.X + t*lc.endPosition.X
	y = (1-t)*lc.startPosition.Y + t*lc.endPosition.Y
	return
}
func (lc *LerpPosition) IsEnabled() bool {
	return lc.isEnabled
}
func (lc *LerpPosition) SetIsEnabled(isEnabled bool) {
	lc.isEnabled = isEnabled
}
func (lc *LerpPosition) IsDestroyed() bool {
	return lc.isDestroyed
}
func (lc *LerpPosition) SetIsDestroyed(isDestroyed bool) {
	lc.isDestroyed = isDestroyed
}
func (lc *LerpPosition) SetEndFunc(endFunc func()) {
	lc.endFunc = endFunc
	lc.isEndFuncSet = true
}
func (lc *LerpPosition) EndFunc() func() {
	return lc.endFunc
}
func (lc *LerpPosition) IsEndFuncSet() bool {
	return lc.isEndFuncSet
}