How do I simulate platform behaviour on mobile

Get help using Construct 2

Post » Sun Jan 08, 2017 1:30 pm

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am currently using arrow keys and spacebar to move my player on desktop.However i can't do the same on mobile.For e.g when a user press up and arrow right on desktop , the player jumps to the right.

I can't seems to achieve the same for mobile ?

Can anybody help me fix this

https://www.dropbox.com/s/fxk61usbim45jow/platformgame.capx?dl=0
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Jan 08, 2017 3:16 pm

@ kab

Couple of things - may be better to have controls in their own group (desktop, mobile) and if on mobile - System create object > up, down, etc. etc.

Why only a space bar on mobile to jump? Better to separate the arrows - left/right on left side of screen - up/down on right side, since the spacebar sprite only jumps on mobile.

This way you can easily manage the events/actions - touch right - move right. touch up - jump. Easy peasy.

Also, mobile controls are very small, and collision polygon should be a bit larger than the actual arrow. Difficult to get him moving on mobile. I kept missing the buttons.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 08, 2017 3:35 pm

I tried this earlier , i can't make the player jump well i think its because of multi touch.Basically if i want to jump right , i press arrow up and right simultaneously but this doesn't seems to work on mobile
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Jan 08, 2017 3:37 pm

If you can modify the capx that woul;d help , all sprites are already in file
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Jan 08, 2017 3:59 pm

@kab
Question- what is the instance variable 'direction' on hero for?
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 08, 2017 4:30 pm

@kab

I think the problem was right in front of me.

With the left/right movement - change 'On Touched' arrow to 'Is Touching' arrow

Let me know if that works. If not, i'll send you the capx.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 08, 2017 4:49 pm

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
@jeffige its already to is touching for me

https://i.gyazo.com/e367c98a9a854e62f2e ... 05da37.png

You can also change the position of the buttons as you said above but i want the space button to make the character run faster(check for keyboard event.It was a mistake on my part
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Jan 08, 2017 4:54 pm

@kab

The problem with that is - you had it 'touching spacebar' to run faster on desktop. Not on mobile.

And you can easily add a different sprite, like a lightning bolt next to the jump button for extra speed.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 08, 2017 4:56 pm

@kab

check your messages. sent you a pm.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 08, 2017 5:31 pm

@jeffige i don't have the same version of construct2 as you ....could you please send me a screenshoot to highlight your changes
B
5
S
1
Posts: 32
Reputation: 389

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests