How do I base a touch off a keyboard click

Get help using Construct 2

Post » Wed Sep 09, 2015 9:39 am

Hi everyone,
Instead of recreating all the events for touch I want to create only a few events which make touching a left arrow simulate pressing the left arrow key. I want to do this for the right arrow too.
thanks
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Wed Sep 09, 2015 1:17 pm

on tap | Simulate control "Pressing Left"

You can add either platformer behavior or 8 directional movement
B
5
S
1
Posts: 24
Reputation: 650

Post » Thu Sep 10, 2015 9:19 am

did not work because i do not want a platformer or 8 direction
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Thu Sep 10, 2015 9:47 am

Why not put all the actions in a function and call the function depending on either keyboard or touch?

You might even be able to do it with a simple "or" block, dependng on how you have your events set up..

on left arrow touched
or
keyboard on left arrow key pressed
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Sep 10, 2015 10:25 am

ok I will try but there must be an easier way
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Thu Sep 10, 2015 10:27 am

What could be easier than making an "or" block?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Sep 10, 2015 10:30 am

and how do i make or blocks if there are other conditions that cant be or in the one event
thanks
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Thu Sep 10, 2015 10:30 am

what would be easier is one evemt saying if this sprite is touched replicate the arrow key touched
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Thu Sep 10, 2015 10:38 am

Tombufa wrote:what would be easier is one evemt saying if this sprite is touched replicate the arrow key touched


Well that would be the case if you used the function object, right?

on arrow key touched - call function

on sprite touched - call function

But I'm not sure why you'd want to replicate when all can be done in the same event with an "or"
Usually all other conditions which would prevent the "or" could be placed as sub-events, but yours might be a special case..
If you could share the event the way it is now, it would be much easier to explain..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Sep 10, 2015 11:09 am

There are multiple events I would have to add or to. One of them is this for example.

On right arow pressed
Sprite1 Animation frame = 26 sprite 1 set animation "Goop"
Sprite 1 is playing "LTR"
System shaker = 0


I want to add an or condition in with still having the three and conditions

thanks again
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 24 guests