How do I switch between platform directions?

Get help using Construct 2

Post » Sun Aug 20, 2017 9:28 pm

I thought I replied to this thread already!

you can do it using Is Mirror condition:

On button touch
- Is mirrored: Set Not Mirrored, do other stuff
Else: Set Mirrored, do other stuff

And you good to go
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
92
S
30
G
22
Posts: 1,987
Reputation: 20,178

Post » Sun Aug 20, 2017 10:22 pm

Ahhh, wel now i am up to date eh.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Aug 20, 2017 10:40 pm

megatronx wrote:I thought I replied to this thread already!

you can do it using Is Mirror condition:

On button touch
- Is mirrored: Set Not Mirrored, do other stuff
Else: Set Mirrored, do other stuff

And you good to go


Thank you! I actually ended up using @99instances2go 's solution to great success. I'm exporting to Cordova/Cocoon right now to see if I didn't eff up code.

Thanks for chiming in! I think it may be a simpler solution, the one you propose, but I already have this in place, haha.
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Sun Aug 20, 2017 10:47 pm

99Instances2Go wrote:Ahhh, wel now i am up to date eh.


Haha apologies for the confusion, and thanks very much for the help!
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Mon Aug 21, 2017 9:14 am

marcoscodas for that you could do it like so

is touching button then move right else
not touching button move left
B
256
S
39
G
15
Posts: 1,983
Reputation: 41,036

Post » Mon Aug 21, 2017 5:10 pm

Lordshiva1948 wrote:marcoscodas for that you could do it like so

is touching button then move right else
not touching button move left


This is actually a pretty cool idea. I've actually compiled an Android export and have been finding that touch controls are not responsive enough as they are for the original concept. I may give this a go.

Thank you for the idea!

By the way, whatever idea I end up using, I'll credit whoever helped me with it in the final game. It's only fair :)
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Mon Aug 21, 2017 8:10 pm

I cant code/test this at the moment, mobile things are all taken.

What about.

Touch > Is in touch
____Touch > Has Nth touch ... Nr = 1 <---- INVERTED
____System > trigger once while true
____________Action simulate Jump
____Touch > Has Nth touch ... Nr = 1
____System > trigger once while true
___________Action > player > Set Vetor X ... to .. Self.Platform.VectorX * -1

1 finger = jump
more then 1 finger = switch direction
should not lag at all
I think, out of da head.
Last edited by 99Instances2Go on Mon Aug 21, 2017 11:07 pm, edited 1 time in total.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Aug 21, 2017 9:37 pm

99Instances2Go wrote:I can code/test this at the moment, mobile things are all taken.

What about.

Touch > Is in touch
____Touch > Has Nth touch ... Nr = 1 <---- INVERTED
____System > trigger once while true
____________Action simulate Jump
____Touch > Has Nth touch ... Nr = 1
____System > trigger once while true
___________Action > player > Set Vetor X ... to .. Self.Platform.VectorX * -1

1 finger = jump
more then 1 finger = switch direction
should not lag at all
I think, out of da head.


Hmmm you think? There will be moments when these inputs will have to be made almost immediately.

Also, I'm doing my checks for change of direction every tick. Maybe that's screwing up with the lag?

Here's my code so far:

Image

Here's the capx: https://www.mediafire.com/file/hs6exaa5eaohw6u/leftright.capx

If you want to sideload the APK and give it a shot on the phone without having to compile, here it is: http://www.mediafire.com/file/x38sr4kvo ... elease.apk

@99instances2go et al, have at it.

Feel free to try something that works better and post back.
B
15
S
5
Posts: 78
Reputation: 1,173


Post » Tue Aug 29, 2017 10:13 am

You do not need every tick
B
256
S
39
G
15
Posts: 1,983
Reputation: 41,036

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: tannerdler and 23 guests