From 4adfdbe0066010646ad705b8d3f19a341d7a396f Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Fri, 13 Aug 2021 13:09:31 +0200 Subject: [PATCH] Made monsters a bit less synced. --- cmd/tins2021/levelcontroller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tins2021/levelcontroller.go b/cmd/tins2021/levelcontroller.go index 124f246..fa5d05a 100644 --- a/cmd/tins2021/levelcontroller.go +++ b/cmd/tins2021/levelcontroller.go @@ -190,7 +190,7 @@ func (r *levelController) Handle(ctx ui.Context, e ui.Event) bool { var jumping []geom.Point for pos, animation := range r.IdleMonsters.Values { for animation.Frame > 0 { - if rand.Intn(10) != 0 { + if rand.Intn(100) < 37 { // P = .37 monster, ok := r.Level.Monsters[pos] if ok && monster != nil { target, ok := monster.FindTarget(r.Level, pos) @@ -222,7 +222,7 @@ func (r *levelController) Play(level *tins2021.Level) { "heart": tins2021.NewAnimations(80*time.Millisecond, defaultAnimationFrames, true, true), "monster": tins2021.NewAnimations(80*time.Millisecond, defaultAnimationFrames, true, true), } - r.IdleMonsters = tins2021.NewAnimations(200*time.Millisecond, 100, false, false) + r.IdleMonsters = tins2021.NewAnimations(40*time.Millisecond, 100, false, false) r.MovingMonsters = tins2021.NewAnimations(16*time.Millisecond, 50, false, false) for monster := range level.Monsters { r.IdleMonsters.Frame(monster)