Suggestion: Pointer Locking in Mouse Object

0 favourites
  • 3 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • In case it hasn't already been mentioned, just thought I'd draw attention to the fact that both Chrome and Firefox now seem to be supporting pointer locking. If this feature becomes part of the native Mouse object in C2, it would allow C2 users to develop a new class of HTML-5 mouse-controlled games that can use "raw" mouse movement data for controls rather than edge-restricted absolute coordinates. Pretty cutting edge stuff

  • I like the sound of that but get the impression it only works in full screen. Could easily be wrong though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In Chrome, this example works without full screen. The page also suggests that "Originally pointer lock was tied to the FullScreen API. Meaning that an element must be in fullscreen mode before it can have the pointer locked to it. That is no longer true and pointer lock can be used for any element in your application full-screen or not."

    Also, just to further reiterate the advantages of pointer lock for HTML-5 games, let me quote the example in the first paragraph of the article, which I think sums it up quite well, although note that with pointer locking the advantages go beyond that of simply implementing first-person shooter controls:

    [quote:3688xaux]The Pointer Lock API helps properly implement first-person shooter controls in a browser game. Without relative mouse movement the player's cursor could, for example, hit the right edge of the screen and any further movements to the right would be discounted - the view would not continue to pan right, and the player would not be able to pursue the bad guys and strafe them with his machine gun. The player is going to get fragged and become frustrated. With pointer lock this suboptimal behaviour can't happen.

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