How do I : Click Something and then click a different thing

Get help using Construct 2

Post » Sun Sep 18, 2016 7:50 am

I'm developing a game about farming. I have to click the plant's seed before clicking to the area we want to plant it,. But, I can't find "on object clicked " on sub events in Construct 2 r 233. Can somebody give me a solution?
B
8
S
1
Posts: 4
Reputation: 418

Post » Sun Sep 18, 2016 9:55 am

You can use a global variable (or instance variable)

here my try to solve your problem
object "seed" clicked set globalVariable to "Seed"

on object "soil" clicked AND globalVariable="Seed" .... do some actions (and at the end od the actions set globalVariable="empty hand"


hope this helps

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Sun Sep 18, 2016 10:12 am

In same event you can't have more than one event beginning by a green arrow, like on click, on somthing etc
Try with variable like this

-If variable = step1 and on clik on plant > set variable = step 2

-If variable = step2 and on click on area > plant your seed
B
18
S
7
G
1
Posts: 56
Reputation: 3,000

Post » Sun Sep 18, 2016 7:04 pm

dieblume86 wrote:In same event you can't have more than one event beginning by a green arrow, like on click, on somthing etc
Try with variable like this

-If variable = step1 and on clik on plant > set variable = step 2

-If variable = step2 and on click on area > plant your seed


You mean like this?

https://www.dropbox.com/s/is7lr57a6lupb ... .capx?dl=0

How it works

Blue = Seed
Green = Ground

Green can only be clicked after a Player clicks Blue first.
Blue disappears once the Player clicks Green only after clicking Blue.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Mon Sep 19, 2016 8:08 pm

Yes, it's a good beginning.
And in function of what you want exactly you will juste need some changes.
Like if you want to use again a ground, don't destroy it but use a variable on him like Grounf_Free > True or False
etc
B
18
S
7
G
1
Posts: 56
Reputation: 3,000

Post » Tue Oct 04, 2016 6:07 am

Thanks for your help
B
8
S
1
Posts: 4
Reputation: 418


Return to How do I....?

Who is online

Users browsing this forum: nahima and 21 guests