How do I Create a button that you have to land on?

Get help using Construct 2

Post » Wed Aug 03, 2016 11:05 pm

I'm creating a platform game, and I was wondering how I would create a button that my guy would have to land on to Activate.

Any ideas?

Thanks in advance!
B
24
S
9
Posts: 109
Reputation: 2,002

Post » Wed Aug 03, 2016 11:07 pm

My guy > on collision with/is touching/is overlapping button (event) > do a thing (action)
Last edited by plinkie on Wed Aug 03, 2016 11:08 pm, edited 1 time in total.
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398

Post » Wed Aug 03, 2016 11:08 pm

overlapping
B
15
S
7
G
7
Posts: 201
Reputation: 5,277

Post » Thu Aug 04, 2016 2:37 am

plinkie wrote:My guy > on collision with/is touching/is overlapping button (event) > do a thing (action)

Do the slashes mean to make it an OR block?
B
24
S
9
Posts: 109
Reputation: 2,002

Post » Thu Aug 04, 2016 2:41 am

No, those are just potential options. It's up to you which is most appropriate. Generally collision is what you want to test, but it depends if the button is a one-shot, or has to be held down.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Thu Aug 04, 2016 3:15 am

blackhornet wrote:No, those are just potential options. It's up to you which is most appropriate. Generally collision is what you want to test, but something.s if the button is a one-shot, or has to be held down.

My button is a one shot button, but I want it to be pushed into the ground when my guy lands on it. I just don't know whether to make it an animation or do something else.
B
24
S
9
Posts: 109
Reputation: 2,002

Post » Thu Aug 04, 2016 3:21 am

You can just move it down. Up to you.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Thu Aug 04, 2016 3:33 am

blackhornet wrote:You can just move it down. Up to you.

Okay. I think I know what I wanna do! Thanks everybody!
B
24
S
9
Posts: 109
Reputation: 2,002

Post » Thu Aug 04, 2016 3:52 am

My guy > collides with button > set button.variable to "active"

button.variable = "active" and button.Y is greater than the ground > button.Y = button.Y - 0.2

button.y = ground.Y > set button.variable to "done"

button.variable = "done" > Do something


That's probably how I'd do it ;)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Sat Aug 06, 2016 4:24 am

SoldjahBoy wrote:My guy > collides with button > set button.variable to "active"

button.variable = "active" and button.Y is greater than the ground > button.Y = button.Y - 0.2

button.y = ground.Y > set button.variable to "done"

button.variable = "done" > Do something


That's probably how I'd do it ;)

~Sol


Thanks, but I've already figured it out how I wanted to do it. Nice alternative, though! :)
B
24
S
9
Posts: 109
Reputation: 2,002


Return to How do I....?

Who is online

Users browsing this forum: justifun, wizdigitech, Yahoo [Bot] and 8 guests