60 times a second

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Set of 60 cursors. All icons are of a high quality. A good choice for RPG game.
  • The engine processes events "60 times a second," but not "360 times a second" :)

    If I move the mouse cursor very quickly over the sprites, the "Increase Size" event might not trigger.

    I suspect the reason is that the game engine doesn't have time to process the event and register the cursor hovering over the sprite. Any ideas on how to fix this?

    Short YouTube video –

    Subscribe to Construct videos now
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Motion is an illusion on computers where objects will jump from one position to another. So yeah, if you move very fast the jump in position can pass over objects so collisions are missed.

    In general in don’t think it’s possible to make events run faster than the refresh rate without a lot of additional logic. Maybe a loop that checks in between positions between the previous and current frame.

    Another idea is to have an invisible sprite that you stretch between the previous and current mouse position and check for overlap with that instead of the mouse.

  • I suppose my first question would be if it is actually crucial that it works.

    Anyway, 60 times a second is relatively low so the cursor can move quite a big distance within a single frame and as such will skip over multiple boards. Since you know the cursors current position, and can store the cursors last position, you get a line that should cover the movement. Then instead of simply checking for overlap, the easiest would be to put a helper sprite at the last position, rotate it towards the current position, set the length to the distance between the positions, then check for overlap of that helper sprite.

    wackytoaster.at/parachute/mouse_hover_roll.c3p

    Framerate mode is set to fixed at 30 in that example to emulate a low framerate (and I left the helper sprite visible) Like this it will trigger the hover effect of all boards that were crossed in that frame.

    EDIT: R0J0 beat me lol

  • I suppose my first question would be if it is actually crucial that it works. - No :)

    Thank you WackyToaster, R0J0hound

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)