Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-26-2002, 04:48 PM   #1
Esquared
Registered User
 
Join Date: May 2002
Location: Pittsburgh, PA, USA
Posts: 342
Send a message via AIM to Esquared
Default Game fps Issues

OK...I have a game that contains about 12 animated movie clips, each controlled by actionscript. They consist of the following:

1. A "Field" movie clip that contains mouseDown and keyDown handlers
controlling basic quit commands and stuff
2. A "Piece" movie clip containing 9 "Block" movie clips and scripted with
simple x axis motion
3. Nine "Block" movie clips each containing a mouseDown handler to check
when they are clicked on
4. A "Crosshair" movie clip with an enterFrame handler to reset it to the
mouses current position

So my question is this...I get slowup...how do I get rid of it?? I don't see that this is too many handlers for Flash to handle or anything, but I want it to run at 30 fps or so and I'm currently getting about 10-15. The biggest issue is the crosshair, which produces noticeable slowup when in motion, but not when the mouse is still. This makes no sense to me since Flash should be setting the coordinates of the clip regardless of the motion of the mouse. Also, I suppose I could somehow alter my code so that the individual hit tests weren't assigned to "block", but instead existed in a for loop in "Field". That would knock out 9 handlers, but I want to know if this is worth doing before I start messing with all the target paths and such. And of course, I still have to add some additional code dealing with my matrices to check for when the "Block" movie clips "land", which is essentially 9 if statements in a for loop. THANKS!

Oh, and I can post the .fla if someone wants to see it...just let me know.
Esquared is offline   Reply With Quote
Old 05-27-2002, 02:45 PM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

That shouldn't be too many handlers, if you make your code efficient. EnterFrame in Flash 5 was the work of the Devil. In FlashMX we can delete the actions when they have served their purpose so they're not so bad.
In general:
- Anything you can do to minimize the use of hitTest is a good thing. Personally I try to avoid it as much as possible.
- You might consider little things like removing ourlines from shapes. An circle without a line around it animates much more easily than does a circle with a border.
- Consider using mouseMove as your crosshair trigger event in place of enterFrame.
.. ahh that's all I can think of. It's late at night.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Game performance issues hlindley Gaming and Game Development 8 03-11-2005 07:44 PM
[AS2] Problems with platform game (jumping and collision issues) Amaster Gaming and Game Development 6 09-14-2004 10:26 PM
[AS2] Tile game or not tile game? krolben Gaming and Game Development 4 07-28-2004 01:41 PM
Html FPS issues Chrille Other Flash General Questions 0 02-09-2004 04:49 AM
retain fps of loaded movie? Paul Ferrie ActionScript 1.0 (and below) 0 12-14-2003 01:22 PM


All times are GMT. The time now is 07:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.