User Tag List

Results 1 to 2 of 2

Thread: Help needed with multi touch object problem

  1. #1
    Clicker Fusion 2.5Android Export Module

    Join Date
    Apr 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed with multi touch object problem

    I have created two active objects, a left and right button which I am using the multi touch object to test if one of these buttons is pressed and if one is pressed then the player is moved in the required direction.

    My game logic is as follows....

    1. A new touch on right button has started....move player right
    2. A new touch on left button has started....move player left

    I also added the following in case the buttons are held down....

    3. Touch 0 is active on right button....move player right
    4. Touch 0 is active on left button....move player left

    This works but has an undesirable quirk, if you hold down one button but then press the other button before releasing the one already in use the direction will not change and the player just continually scrolls in the unchanged direction.

    I think it's because of the touch 0 events, I am guessing that the second keypress becomes touch 1, is there a way to make it so only the most recently selected touch is acted on, so that only one of the onscreen buttons can be touched?

    Dave

  2. #2
    Clicker Fusion 2.5Android Export Module

    Join Date
    Apr 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can any one help solve the problem quirk, please?

    I amended the events so that there is a string which tells the game if the player should move left or right but I still find that if you have a button held down and then release it, sometimes the player will not stop but instead move in the opposite direction as if the other direction button is being held pressed. I have tried and tried, searched the forums and looked at examples but I still have not been able to figure out why this happens.

    I think somehow I am handling the multi touches wrong, I want only one touch to be able to be active at any one time (so if the player is pressing the left button but then touches the right button only the most recent touch will be acted on) but whatever I try seems to always have the same result, ie the odd quirk of movement when a button is no longer being pressed.

    I amended the events so that they read as follows:

    1. If touch 0 is active on "left button" then set global string A to "LEFT"
    2. If touch 0 is active on "right button" then set global string A to "RIGHT"
    3. If touch 1 is active on "left button" then set global string A to "LEFT"
    4. If touch 1 is active on "right button" then set global string A to "RIGHT"
    5. If a touch has ended set global string A to "STATIONARY"
    6. If global string A equals "LEFT" move the player left six pixels
    7. If global string A equals "RIGHT" move the player right six pixels

    There are no other movement controls, no on screen joystick etcetera, so whatever is causing the movement when buttons are not pressed has to be as a result of these events but how?

    Thanks in advance for any ideas on solving this,

    Dave

Similar Threads

  1. Multi-Touch Problem
    By kingtigre in forum Android Export Module 2.5
    Replies: 0
    Last Post: 28th March 2014, 12:49 PM
  2. How to test multiple fingers with the multi touch object?
    By XStar in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th August 2012, 05:59 PM
  3. Multi touch - very simple example needed
    By iamjot in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 21st January 2012, 03:43 AM
  4. multi touch
    By cfullerNY in forum iOS Export Module Version 2.0
    Replies: 8
    Last Post: 17th January 2012, 07:11 PM
  5. Request Multi touch object
    By DJFuego in forum Extension Development
    Replies: 3
    Last Post: 8th August 2010, 10:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •