Fixed bug where player isn't able walk when any animation is playing.

This commit is contained in:
Sander Schobers 2019-12-29 17:29:33 +01:00
parent 8d8753f008
commit 3fb808ba78
2 changed files with 1 additions and 7 deletions

View File

@ -97,7 +97,7 @@ func (s *playLevelState) Tick(now time.Duration) {
}
func (s *playLevelState) TryPlayerMove(dir geom.Point, key allg5.Key) {
if !s.isIdle() {
if s.player.scr.pos != s.player.pos.ToF32() {
return
}
@ -179,8 +179,6 @@ func (s *playLevelState) findEntityAt(pos geom.Point) *entity {
return s.sunken.FindEntity(pos)
}
func (s *playLevelState) isIdle() bool { return s.ani.Idle() }
func (s *playLevelState) isObstructed(pos geom.Point, idx int, t tile) bool {
if s.bricks.FindEntity(pos) != nil {
return true // brick

View File

@ -18,10 +18,6 @@ type animation struct {
done AnimationDoneFn
}
func (a *Animations) Idle() bool {
return len(a.anis) == 0
}
func (a *Animations) Start(now time.Duration, ani Animation) {
a.StartFn(now, ani, nil)
}