|
-
w00t
Yeah, Nice work squize eheh.. Shame my memory isnt as good as yours.
Somone proved that having say:
thisisanobsenelylongvariablename = 1;
is alot slower than:
shorter = 1;
Umm.. this might be trivial.. but flash 4 syntax also includes using AND and OR instead of && and ||... If history repeats itself, than flash 4 should be faster... but then again, the reason nobody uses flash 4 syntax is its terrible.
and as squize said, in an if statement, if say your checking if the key is down, and the alpha of it is > 50.. figure out which of those is MORE likely to be false and put that first, so say its more likely the key will be up do it like:
if(Key.isDown(blah) && _alpha > 50){
}
It saves a bit of time, especially with REAL long if statements, which if broken up would take 10 or 15 lines >=) (we've all had them)
If you have a object thats going to be at 0 alpha for a while, just _visable = 0; it, 0 alpha's still get drawn.
If you have say, bullets.. and your doing it the crappy "give them all enterframe methods" (which EVERY one is guilty of), try not to give the attached clips many variables.. Ive noticed the difference of say giving them, x, y and speed with giving them x, y and having a standard speed.. over time its more things for flash to store,
oh and obviously, if the projectiles are using Math functions which need deg->rad, keep the variable with the value of 180/Math.PI OUT of the clip, thats just more space which isnt needed.
Marg.. Im sure there are plenty more.. But I have uni in 6 hours and I need sleep..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|