How do I make only selected sprite option?

Get help using Construct 2

Post » Sun Dec 06, 2015 11:05 pm

I'm making a game that'll have options to upgrade, and in turn, earn more money. I thought it'd be easiest to make a sprite for every building, and different animations for each "upgrade". But if someone makes two of the same building, and then upgrades one, both sprites will change to the upgraded animation.

My game has 36 spots for buildings, and the player can build whatever they want. Is there any way to make it so only the clicked sprite's animation changes?

If this has been asked before, please forgive me and help me find the post. I, for the life of me, can't find this answer anywhere.
B
8
S
1
Posts: 10
Reputation: 372

Post » Sun Dec 06, 2015 11:26 pm

You need a way to differentiate the two buildings. I'd recommend an instance variable for each spot or building. Then, when a building is clicked, you can tell which has been selected. Hopefully this simplistic example helps:
Image

There may also be a solution that uses the buildings UID's, but I don't have much experience there.
Image
B
11
S
4
G
1
Posts: 30
Reputation: 921


Return to How do I....?

Who is online

Users browsing this forum: unicornspitfire and 51 guests