SLIDE + PRESS can't work at the same time :(

zellhuangzellhuang Member, PRO Posts: 79

Hello GSers,

I'm working on an action project. I designed the control system as this way: slide up/down to make the role move up or down, press ACTION button to attract an object and then release the ACTION button to shoot the object ( just like the gravity gun in the HALF LIFE 2).

Right now, I have made both of the 2 functions worked separately. But when I want them working at the same time, the slide function can't work. That means when pressing the ACTION button, can't slide.

I've been thinking about the solution for several days. I think it might be the mouse position.
I use an actor to control the slide function:
1.create 2 real attributes in the actor which are touchY releaseY
2.make these rules:
rule NO.1:when touch is press, change the touchY to mouse positionY.
rule NO.2:when touch is release, change the releaseY to mouse positionY.
rule NO.3:when releaseY>touchY, interpolate the ROLE position Y to 500; when releaseY<touchY, interpolate the ROLE position to 100

this slide actor is on the left side of the screen and the ACTION button is on the right side of the screen.

can anyone give me a solution of this problem. thx in advance :)

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited August 2016

    Since you need touch coordinates for the slide function, and you can have more than one finger on the screen at the same time, you need to figure out witch touches coordinates to use.

    Search for "gamesalad multitouch" on youtube. There´s an excellent tutorial made by The Guru.

    Mental Donkey Games
    Website - Facebook - Twitter

  • ArmellineArmelline Member, PRO Posts: 5,331

    You should be able to do this without delving into the complexities of multitouch. Perhaps post a stripped down project file showing just the control actors and the role actor, so we can see exactly what you're after. I'm afraid after reading your description I'm not entirely clear on what you're trying to do.

  • zellhuangzellhuang Member, PRO Posts: 79

    @MentalDonkeyGames said:
    Since you need touch coordinates for the slide function, and you can have more than one finger on the screen at the same time, you need to figure out witch touches coordinates to use.

    Search for "gamesalad multitouch" on youtube. There´s an excellent tutorial made by The Guru.

    thx for the help. I've watched all the video about multitouch on youtube posted by Guru, but none of them has any information about slide+press multitouch :(

    I think i can change the rules to detect slide which means don't use the release rule but only use the press rule. I'm gonna try my idea, if it work out, i'll come back post it :)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Give this a try.

Sign In or Register to comment.