PDA

View Full Version : bullet skipping target.



xytor
February 12th, 2007, 03:37 PM
I have a small game where targets appear dynamically and you can shoot them with bullets that come out of a fully automatic gun.
this works most of the time, however sometimes the bullet just goes straight through the target, as if the hitTest isn't there.

Does anybody have any idea why?

leadbit
February 12th, 2007, 04:21 PM
yeap - the prob is quite simple, you have to write a func that would process hitTest for all the objects and all the bullets on the scene, then make a setInterval with zero(0) latency - it would take the func on a higher priority level, so on each timer tick your conditions would work and the bullets woudn`t fly through the target - I`m always using this technique
hope this makes a sence ;-)

xytor
February 12th, 2007, 04:24 PM
Yep, i figured. Thanks a lot...