hi Pedro, bitmapcaching would make it MORE processor intense, not less.

Visited your web page, but I can't seem to download... is this option only possible if I am registered? You might just want to give a link to a zip file instead - simpler.

Things to check in general:

1. how you are animating the objects: use a controlling MC that triggers each ball to move, instead of having each ball do an 'onEnterFrame' can help tremendously: but that's not always possible. 2. Make your balls simpler: no outlines, no gradients, no alpha gradients, alpha:1 or 100 [AS3 or AS2]
3. reduce quantity or reduce frequency of new ball generation/updates.
5. Avoid calling floating numbers, round them up to integers when possible.
6. Use multiplications over divisions and use bit operations instead of both, when possible. 10/2 is slower than 10*0.5 which is still slower than 10>>1. 7. Optimize if-then statements so that you first check for the least/most common occurance 8. optimize if-then statements so that you don't check the same object more than once [this can occur in badly written hit collision tests]

and more... there are lot's of options and pitfalls to good code vs bad code...
:P

You can also check the net work similar code done by others, there is a heap of bouncing ball examples all over the place. Try respected sources like 'friend of ed' and 'oriellies' for code you know has been well thought out, or from a good blog where its a pro who is illustrating things.

Modifying their code will be a lot easier and less prone to processor-loads that could occure when you are coding from scratch and not sure what the best way to program it is...

hope some of this input was useful.
:)

Seb.

Pedro Kostelec wrote:
Hi list

I have created some balls being moved randomly (not completely) over the
stage, with a Glow Effect of 100,100 blur. All this together is very CPU
intensive. I just wondered if someone could check my files, and tell me how
to optimize it, to work faster and use less CPU? Would bitmap cache do the
work? I have 0 experience with bitmap cache, so if it would help, could you
tell me a link to a good tutorial or a good piece of code?
Here you can download my files:
http://www.humyo.com/2000999-217133957  (Right click on each file separately
and chose download)

Thanks


*Pedro D. Kostelec*
[EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to