Mouse Lock / Pointer Lock API access

  • Ashley

    I know there was a C2 discussion on this.

    I didn't really understand what Mouse Lock or Pointer Lock was at the time I read it but now that I am trying to implement KB&M control on my game I have come to the conclusion that access to this API is essential for many modern 2D games

    and I would very much like access to the mouse lock / pointer lock API for my game.

    My in work game is a twin stick shooter. The primary method of control is dual analogue joypad Secondary method would be dual touch

    However I would also like to implement mouse keyboard control, as although it would be preferable for player to use one of the other methods it is likely that most will first come across my game by way of PC with only KB&M access.

    But I do not want the gun angle to follow a crosshair mouse cursor on screen.

    Although this control method is common in many games it is super lame for what is intended as dual analogue control. (as it essentially allows KB&M players to just rest cursor over intended target and move ship with wasd/udlr keys while cursor will remain on target always so gun angle will always point to target. (i.e. there is no aiming skill requirement)

    what I want is the player to be able to make circles with the mouse that dictate the gun angle

    I have already made this work without mouse lock (by dragging an invisible pivot point around close behind the invisible mouse position. and using the angle between mouse position to pivot point position to set gun angle.)

    however this falls flat on its ass as soon as the mouse position hits the edge of the screen. full screen or not.

    As you can see in this case it would be real beneficial to have mouse lock / pointer lock

    .

    in fact any dual analogue type shooter would benefit from mouse / pointer lock.

    there is also another alternative and preferable control scenario that does have a crosshair on screen dictated by mouse movement but the crosshair also moves in line with player. This also requires mouse / pointer lock

    mouse/pointer lock would clearly be turned off on any menu or on escape etc to avoid annoying player.

  • There's an addon for mouse lock, maybe ask them to port it to C3.

  • There's an addon for mouse lock, maybe ask them to port it to C3.

    Have done. I know your busy with C3 Runtime etc. But if there is any possibility of having a official plug in the future that would be very welcome. I may raise a c3 suggestion fwiw.

    Maybe it is time for me to learn some real programming and look into the addon sdk.

    how hard can it be ????

    (I can already hear all the real programmers chuckling in the background...)

  • > There's an addon for mouse lock, maybe ask them to port it to C3.

    >

    Have done. I know your busy with C3 Runtime etc. But if there is any possibility of having a official plug in the future that would be very welcome. I may raise a c3 suggestion fwiw.

    Maybe it is time for me to learn some real programming and look into the addon sdk.

    how hard can it be ????

    (I can already hear all the real programmers chuckling in the background...)

    Armaldio's been busy with a lot of stuff recently, I will ask him about the progress of the rewritten plugin (with C3 support) again. Last time I checked, the new plugin had issues with Construct 3 on startup. We want a rewrite because we don't want to provide support for two completely different versions of the plugin.

    The Mouselock API is generally a pain to work with so I understand why Ashley wouldn't want to deal with it right now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • We deal with thousands of bug reports, hundreds of feature requests, and we only have 3 developers. The whole point of the addon SDK is to take the pressure off us and allow third-parties to cover extra features like this.

  • TheRealDannyyy

    Cool. Sounds promising.

    Although I saw in another thread that C3 runtime will have a new addon SDK and format.

    Anyway I am in no rush but it certainly would be pretty awesome to have in the future.

    Ashley

    No problem , fully understand. It will be great to see the addon repositry grow.

    I wish I had better skills in this area so that I could support. (i think I will try to start learning some JS)

    Just FYI the " how hard can it be ????" comment was not directed at you ... it was supposed to be sarcasm directed at myself... just in case it came off wrong.....

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