Stop mouse from tracking upward to top of screen

0 favourites
  • 5 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • We have a game similar to pong, but the glove is along the bottom of the screen. The user controls the glove with the mouse and moves left-right across the x-axis to catch baseballs dropping from above.

    We have noticed that even though we move the mouse back and forth, the cursor (which is hidden on the playing field) starts to track upward towards the top of the screen. The cursor is also visible to the left-right of the playing field when it touches the background image.

    Once the cursor makes it's way to the top of the screen, the default pop-up menu in Chrome (the game must play in full screen) and interferes with the the mouse movement - causing issues in the game.

    What is strange is when i move my mouse left-right in Word, or any browser the cursor does not track upwards. But in Construct 2 - this seems to happen automatically.

    Is there a way to attach the cursor to the glove or prevent the mouse from tracking up to the top of the screen? Any help would be appreciated.

    -Mark

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should probably the Browser fullscreen feature (tutorial), rather than manually pressing F11.

    Otherwise third-part plugin Mouse lock with the compatible browsers can be of help.

  • You can use an "System > Every Tick" condition where "glove > Set X" is always on mouse.x and "glove > Set Y" is always on mouse.y .

    And add another condition to it for instance: "Glove > Compare X" where X is always higher than a certain height or else it won't move the mouse cursor.

    You can put the "Set Y" and "Set X" seperately inside the "System > Every tick" condition to make it so the glove still moves sidewards (mouse.x) but not upwards or downwards(mouse.y).

    Hope this helped you a bit with your issue

  • Kyatric & Rezamertag,

    Thank you both for your suggestions.

    I have forwarded them to our developer and will get back to you with the results!

    -Mark

  • We have installed mouse lock - but when you click to hide the cursor, the sprite does not move left or right. Is there an additional setting we need to implement so mouse movement still controls spite movement left and right?

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