[haXe] Animation performace issues
Jaevla Faenskap
harikke at email.com
Tue Aug 28 19:39:33 CEST 2007
edA-qa mort-ora-y :
>> there is no more stuttering, which is good, but the movement is still
>> not very smooth. If I move the player-clip 5 pixels per update, I can
>> clearly see two of them moving along... Maybe I need some kind of
>Are you by chance using an LCD/TFT monitor? At such high movement rates
>the pixel response time of the monitor may be an issue. Is what you're
>seeing like a shadow trailing the object, or two blurry objects moving
>together? If yes, then you are likely seeing monitor effects which have
>nothing to do with flash. You may have never noticed in other games
>before likely because you just never paid such close attention as to
>your own game.
Hm well might be, but I'm a bit suspicious to that beeing the reason.. I've written games in SDL before and haven't had the problem there. Might be because of the simple geometry and the colours I have though. I'll try with some more eyecandy and see if it gets better.
>> As for your 3. it seems you are right, removing the
>> collision-detection I can see no slowing down. I'd love to have a
>> look at your routine, if you would be so kind.
>Attached the two files. should reside in the
> directory and should reside in a
> subdirectory -- this odd structure is to workaround a
>[possibly old] haxe defect.
>Quick use is simply:
> col = new ObjectCollider( flash.Lib.current.Stage );
> if( col.doCollide( spriteA, spriteB ) ) ...
>I was using Sprite's but I think anywhere a Sprite is referenced should
>actually be "DisplayObject" to handle MovieClips as well.
>The constructor has two additional parameters for using filters and the
>alpha level to consider intersected. I don't know if you need to worry
>about those.
Thanks, great stuff. I'll give it a go.
>> You are quite right in 4 - I could have used a sprite for all the
>> objects I have here, but in the end I would like them all to be
>> animated. Is this unreasonable to expect with flash? I've seen a demo
>It depends how you want to do animation. I use Sprite's and a timer. I
>suppose using MovieClip and the enterFrame event is comparible.
I just figured the MovieClip would be simpler from a programming POV, and want to focus on content rather than optimization for now. I've been doing some experiments with copypixel though, and I think I'll choose that approach when it comes to that. Makes it easy to do double-buffering as well.
The demo I was referring to is at: http://mikegrundvig.blogspot.com/2007/05/copypixel-is-faster-then-sprites.html
>> For your 5 - how do I then free memory? Should I rather re-use the
>> objects that move out of view?
>I had the same concerns before, but once I made a better collision
>detector the memory use dropped to a trivial amount I didn't need to
>worry any further.
>Otherwise I do some object caching, but there is a large caveat here,
>maintaining the cache also uses memory that will need to be cleaned up
>at some point. Only in a few cases do I reuse sprites in my game, and
>I'm not sure how much it really helps...
Ok, I'll try not to worry either ;)
BTW: Shouldn't my mail end up in the same thread if I just reply to a mail from the list, or is there something else I need to do? I'm too used to forums really :)
Cheers.
--
We've Got Your Name at http://www.mail.com !
Get a FREE E-mail Account Today - Choose From 100+ Domains
More information about the Haxe
mailing list