GLBasic forum

Main forum => GLBasic - en => Topic started by: Millerszone on 2010-Oct-26

Title: Stutter using ANIMCOLL
Post by: Millerszone on 2010-Oct-26
Using this command batHitBall = ANIMCOLL(ball,0, ballX, ballY, bat, batAnim, batX, batY) I get about
a 1/2 second stutter of the ball when I swing the bat, but it only happens with the first pitch and
on a slow computer. After the first pitch it works fine, smooth and on my quad PC the ball never stutters.

I even tried putting ANIMCOLL(ball,0, ballX, ballY, bat, batAnim, batX, batY) in the main loop and still
the same thing.

Any help would be appreciated.

Mike
Title: Re: Stutter using ANIMCOLL
Post by: Hatonastick on 2010-Oct-26
When you say 'slow computer', we talking Netbook here?
Title: Re: Stutter using ANIMCOLL
Post by: Kitty Hello on 2010-Oct-26
Yes. When you first use SPRCOLL on an image, I read the collision pixels into an array. That takes time. If you want to pre-load that, use:
SPRCOLL(id,0,0, id,0,0)
on that sprite after you loaded it.
Title: Re: Stutter using ANIMCOLL
Post by: Millerszone on 2010-Oct-26
Thanks that worked.

I was testing on a older Acer 1.5Ghz laptop, but it also did the same thing on an iPad.