Tower defense problem!

Get help using Construct 2

Post » Sun Jul 17, 2016 9:37 am

I wanted to make a system where if the mouse hovered above a tower it will show a "upgrade" button. I got that working, but the button would stay there forever. is there any way to get the button to be destroyed once your cursor has passed it?
B
6
Posts: 46
Reputation: 336

Post » Sun Jul 17, 2016 10:53 am

have you tried to copy the same action for hoovering with the mouse but instead of creating the popup actually destroy the object

Please upload a CAPX
B
7
Posts: 52
Reputation: 381

Post » Sun Jul 17, 2016 2:18 pm

Tried it, dint work
B
6
Posts: 46
Reputation: 336

Post » Sun Jul 17, 2016 5:19 pm

do you have a CAPX file so i can look at the event code?
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 18, 2016 5:51 pm

Armouredank wrote:I wanted to make a system where if the mouse hovered above a tower it will show a "upgrade" button. I got that working, but the button would stay there forever. is there any way to get the button to be destroyed once your cursor has passed it?


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

Right click and invert the condition.

To be more flexible, I recommend utilizing an invisible helper sprite to define the area where the the popup stays visible instead of using the objects themselves. This will allow for more flexibility in placement of the popup, as well as stave off issues when you have multiple or other objects creating and destroying the same popup.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Tue Jul 19, 2016 9:14 am

I'd recommend to simply make the button purchase visible/invisible instead of destroying it.
Whether you are using only a single one or have a different button per tower instances.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Jul 19, 2016 10:44 am

Thanks. it works!
B
6
Posts: 46
Reputation: 336


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests