The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 8 of 8

Thread: Frame rate issues, particularly on mouse movement

  1. #1

    Frame rate issues, particularly on mouse movement

    Hi All,

    I've been browsing through these forums and have already found lots of ways to optimize my frame rates for a game I've been working on:

    http://www.dukesbox.net/dev/game18.php

    The improvements have gone quite well so far, the major problem I'm having though is that when a user moves their mouse across the game, frame rates slow / the whole thing comes to a halt. I cant work out exactly why this is...

    Any thoughts on this problem or any other advice people might have for me to speed up my game would be greatly appreciated...

  2. If you are using a mouse listener you should be able to find out whats the problem. You probably use a terrible slow code somewhere in the onMouseMove = function () { part?

  3. #3
    At a glance, there really isn't any way to tell why the frame rate drops - so i'll just blame yr. coding.
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  4. #4
    i've not been using a mouse listener, just every tile on the grid has a button on it which is clickable... these tiles are dynamically generated at the start. I'm guessing this is a bit of a dumb way of doing it and I should be using a mouse listener?

  5. #5
    I would just calculate what tile the mouse is one when you click and then do the build function.

  6. #6
    I would love to be able to blame my coding too, if only my code got executed when there was any kind of mouse over event.... however there isnt, the only code dependant on the mouse is when a user clicks so I'm really not too sure why this happens?

    Could it be that my version of flash is outdated / needs patching?

    It seems very odd to me that my movie can be slowed / paused just from mouse over effects on buttons that have very very basic rollover effects...

  7. Quote Originally Posted by andrew2110 View Post
    I would love to be able to blame my coding too, if only my code got executed when there was any kind of mouse over event.... however there isnt, the only code dependant on the mouse is when a user clicks so I'm really not too sure why this happens?

    Could it be that my version of flash is outdated / needs patching?

    It seems very odd to me that my movie can be slowed / paused just from mouse over effects on buttons that have very very basic rollover effects...
    I guess it's so slow because buttons are just slow. I'm not sure though. But I think that flash's buttons are a bit slow when used in massive numbers like that. Probably flash only checks if a mouse is rolling over or rolling out when the mouse is moving, that would make a lot sense since the mouse can't enter another tile when it's not moving.

    To improve the speed simply don't use buttons, you can easily achieve the same effect by this

    _root.squareTileMouseThingy._x = _root.background._xmouse/tileWidth;
    _root.squareTileMouseThingy._y = _root.background._ymouse/tileHeight;

    And only check where to place the turret or execute any action only on mouse click:

    _root.onMouseUp = function () {
    // code stuff, selecting turrets, building turrets / whatever....
    }

  8. #8
    Thankyou for the suggestion, I'll get on to implementing that now..

    I did find the reason why it slowed down so much that it was almost paused... Previously I had a movie clip 'Tower' which had all the movie clips for fire tower, freeze tower fast tower etc... nested inside it, and they were just set to visible and invisible as and when they were needed (only the 'activeTower' ever did any processing though)... Now that I've made it so that only the active towers movie clip is loaded in I dont have any more slow down on mouse movement.

    I can see how changing the mouse code instead of using buttons would make things a bit faster still so I'll get cracking on that now, thanks for your help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012