Mouse conrol bug

0 favourites
  • 7 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Problem Description

    ____ A concise description of your problem here ____

    NOT WORK THE FOLLOWING RANGE:

    MOUSE - ON KEYDOWN--CLICK (ALL DIRECTION EXEPT RIGHT) - SPRITE

    • 1. SIMULATE CONTROL (ALL DIRECTION EXEPT RIGHT)
    • 2.SET SPEED ( ANY NUMBER).

    I have long sought to this on my simulator and using object Touch ( with Simulate control,of course).

    When I replaced the Touch object by Mouse and Keyboard ( both, and separately) and created a new project for testing, then i found that the second action (set speed - px. per sec., the first action - direction - right, left,ect) - set speed work only in one direction - always in right direction, and sprite move only right directhion ignoring that i click on left ( and middle) buttom of mouse.

    Attach a Capx

    ____ Upload a Capx to this post ____[attachment=0:1cuwqwxg][/attachment:1cuwqwxg]

    Description of Capx

    ____ Concise description of what this CapX does ____ sprite goes in 4 direction by control mouse or keyboard

    Steps to Reproduce Bug

    • Step 1click Run
    • Step 2 click on left button of mouse first or middle button mouse
    • Step 3 etc.

    sprite allways move in right direction.

    Observed Result

    ____ What happens? ____

    but sprite goes to the right direction again with some vibration.

    Expected Result

    ____ What do you expect to happen? ____

    expected result - when i click on the lef to of mouse button - sprite must move to the left direction, when i click on the middle buttonof mouse - sprite must move to the up direction

    Affected Browsers

      Chrome, Mazilla
    • Chrome: (YES/NO) YES
    • FireFox: (YES/NO)YES
    • Internet Explorer: (YES/NO)

    No

    Operating System and Service Pack

    ____ Your operating system and service pack ____

    Windows 7 64 SP1

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using ____

    163r AND 167.2r(64-bit) ( same result)

  • I did not look at your .capx (because I'm using a stable release) however be aware that you should not use the mouse object when you are using the touch object actively together. I've found this can cause undesired results especially when using simulate control events .

    In the cases where your game requires both, do the following to avoid conflicts:

    Put all of the mouse conditions and events into a "Group" and call it "Mouse Group" for example and put all of your touch conditions and events into another group named "Touch Group". Then use the system object to create a condition "On Start of Layout" and create 2 sub events,

    System > Is on mobile device > set group "Mouse Group" deactivate

    System > Is on mobile device (x) > set group "Touch Group" deactivate

    (x) meaning invert

    This is should give you other ideas on how handle this and other situations.

    This also saves memory because there is no listening for conditions not being used. You can group all keyboard events into another group and deactivate that group as well when on a mobile device to improve performance.

    Also when using "simulate control" set the "use default control" in properties to no.

    Hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for good advice, but there are not Touch object. I did one new clear project.

    My real goal is have normally accaleration work for ball game on mob device. But it work very strange ( Touch-Simul. Cont.-8Direct).

    Then i made that simple project with mouse ( keyboard work is right) - it does not work too.

  • This is happening because you don't understand how the 8 direction is working or how the mouse triggers are working.

    1. Read the manual for both again.

    2. A mouse trigger will happen only once per click event, which is incompatible with input controls for 8 dir.

    3. Setting speed to 50 will set speed for the direction the object is facing, hence why always to the right and then slowing to a stop. Remove the speed 50 commands and change the click trigger to mouse button down and it will work properly. If you want to command a movement on a click then you need to use custom movement and set speed rather than 8 dir movement, which expects continual player input for control.

    4. This should be in the "How Do I" rather than the bug section....

  • 1.I have asked

    /forum/viewtopic.php?f=147&t=101499

    /forum/viewtopic.php?f=178&t=101603

    but i did not got the answer for a problem

    2....

    3. I don't see things that you told me

    /manual/114/mouse

    4.. Setting speed to 50 will set speed for the direction the object is facing, hence why always to the right

    i don't understand why really.

  • No probs - it's a steep learning curve getting used to how C2 manages its events and how objects can be controlled. The forums are really helpful places to air your problems, but if the answer can be found in a tutorial or in the manual then you might not get an answer....

    I recommend that the best way to become familiar with it is to go through a few tutorials and have a look at the example capxs. Looking at how other people have managed things is also a great way to give you ideas. But the bottom line is to have hands-on experience with C2.

  • Closing as won't fix. 'Simulate control' does not have immediate effect: controls are only checked at the end of the event sheet. So when it then does the "Set speed to 50", the object is not moving or being controlled, and if you set the speed of a stopped object with no inputs it moves it at 0 degrees (to the right).

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