Fixed bug where player isn't able walk when any animation is playing.
This commit is contained in:
parent
8d8753f008
commit
3fb808ba78
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user