Mobile Thumbstick- AKA touch control, multiplayer

Get help using Construct 2

Post » Thu Nov 15, 2012 5:59 pm

I think this is the prettiest and simplest way to do it.



Set a drag object, and use the angle between it and the "thumbstick base" to set the angle of motion.

You can definitely be creative and add the running/walking control by either adding separate base,

or just by calculating the distance between thumbstick and the base.

Eg,thumb is dragging-->playerbox move distance(thumb.x,thumb.y,base.x,base.y) / "Insert your number here"


Capx



Simpler, Neater, offering precised control, and offer easier customization.



P.S.: I guess I done my little part to contribute to this forum =P
I will appreciate someone else spend some time to teach me all the expression and tricks about multi-touch~!(No the manual and tutorial is not helping at all)ZhaoYun2012-11-16 05:53:50
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Fri Nov 16, 2012 12:45 am

Could you please put up an HTML sample. I don't use beta versions and I want to test this out on an actual touch screen.

Honestly I completely overlooked the Drag and Drop behaviour. Though I tried to simulate it by doing the same form of checking to see if the touch was still touching. I found that it was unusable as the touch would lose it's requirement of still touching thumb stick. However maybe the drag and drop behaviour will be more solid in monitoring the touch position even when the finger slides off the thumb stick.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Nov 16, 2012 1:05 am

Thanks. I really appreciate you showing the drag and drop behaviour. I think it works out really well :) I think the tutorial will be a lot better for your contribution once it's updated :)

You rock :)
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Nov 16, 2012 5:50 am

I'm glad that someone find this useful =)


*I donno why lately I just can't upload to dropbox and share the html, it always error 404*

I am sorry there is no html exampleZhaoYun2012-11-16 05:53:26
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Fri Nov 16, 2012 12:38 pm

There is easier than this ... A 2 event version !
But Well ... Nice One !Whiteclaws2012-11-16 12:39:38
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sat Nov 17, 2012 7:52 am

wow! do you mind to share?
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Sat Nov 17, 2012 12:52 pm

@ZhaoYun
What would you like to learn? I can teach you, if you want.
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Sat Nov 17, 2012 1:57 pm

This is part of the original post and not on the OP interest of whiteclaws 2 event and lonehangman offer.

So I was experimenting with dragged objects and the sample that OP posted. I like the design. use of the drag and drop is better. As I've already stated. However I found that in trying to capture a more intuitive and responsive controls the above example doesn't have the same polish as say Street Fighter 4, Grand Theft Auto for Android/ios.

First I wanted a larger area of input for where the thumb can start pressing graphically. the entire Touchpad area. I found making the control stick the same size had a draw back. The drag and drop feature follows where the object was grabbed. This resulted in a problem that even if I wanted to do a double tap I needed to "grab" the center each time. Where as tapping the side of the pad twice was ideal. The solution right now is to what seems a mandatory third event.

Second, it's purely personal taste. But I don't like the joystick stick part being able to be dragged entirely across the screen. So in the OP Thumb1(assume lower left) can be dragged all the way to the upper right. This is personal. I've seen games use this and there is nothing wrong with the choice. However....

a floating thumbstick results in unreliable analog based input. Analog referring to range of of left/right up/down and not angle. Since we are talking about touchscreens that range from 3.5 to 10 inches and a diversity of resolution. being reliant on distance will produce unreliable results. Due to the nature that distance and radius is dependent on device. That it is best to due a percentage based translation.

However, ZhouYun does have a point. The 2 event style he uses is as simple as it can get. However I would change the "Not Dragging" to "On Drop" instead. A "Not Dragging" condition will fire the code afterwards. So in his example Thumb1 when not dragging is having it's position set every frame. It's only 1 command, but it's not needed. Where as a "on drop" will only fire when an "on drop" event occurs.

Anyways. Again I appreciate the OP input and will change the article to a better way :)jayderyu2012-11-17 13:57:51
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sat Nov 17, 2012 2:39 pm

@lonehangman
Oh WOW! I am excited to learn!

Lets start with this question, how do we specify touch?


I think this is the best way to ask:
ZhaoYun2012-11-17 14:40:02
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Sat Nov 17, 2012 2:52 pm

@jaderyu

Interesting input!
I too, don't like the fact that using drag and drop means I have to retouch- and re-drag the thumbs from the center position every time I accidentally drop it.
(If I learn how to do the thing I asked on previous post, I would change the touch control into calculating angles between "Control" and "Touch" right away)

I opt using "is not dragging" over "on drop" in order to have the thumbs position on the center of the touch pad on the start of the layout, and in case that it was dislocated from the touch pad for whatever reason.

I always wonder though, if an event is always true, does it makes the event always firing?

for example as you say, when I use "when thumb is not dragging, set position of thumb to control", does the construct doing work reposition thumb to control every tick, taxing performance?
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests