Making a Touch Platformer : Controls Issues

Get help using Construct 2

Post » Tue Nov 11, 2014 3:15 pm

Hello !

I'm trying to make a platformer with touch control with only two "buttons".

Basically, If you Maintain right, the Left button become a jump Button.
If you maintain Left, the Right button become the jump button.

Here is the thing :
When i keep pressing Left (First) then Keep pressing right, I jump (That's good)
But when i do the opposite (Right first, then Left), Left "Overtake" right.

Here is the code :
So, on the code side, whenever i touch the Left button, Touchstate =1.

Any idea ?
I personnally think this is a conflict in multitouch but i may be wrong.

If you'd like, Here is the .Capx . You'll find this portion of the code in the Group PlateformMode->Control
You can play here, On your favorite touch device
Posts: 2
Reputation: 390

Post » Wed Nov 12, 2014 3:00 pm


Had a little look at this just now. It seems it was related to the fact that you had the touchstate variable as a local one rather than global. If you move up to the top so its global then it works for both ways. I guess C2 was setting it back to 0 every time it was running through the code? By moving it out it did cause some other issues with the controls going a little funny so I changed a few other bits. I've attached the .Capx file edited and also a link to it on dropbox. Hopefully this helps =) The lines I amended I have bookmarked so you can see what changed (around 3/4 lines). You will also need to change back the text - test as I changed it to append so I could see what values of touchstate were being passed.

Capx: ... trols.capx

Online Link: ... index.html
Posts: 212
Reputation: 4,545

Post » Thu Nov 13, 2014 12:42 pm

Ho you !
Thanks a lot. :)

It seems that a new weird problem has appered but i'll try to figure it out by myself first
Posts: 2
Reputation: 390

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests