Made monsters a bit less synced.
This commit is contained in:
parent
0d49482036
commit
4adfdbe006
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user