How do I do this

Just started using Construct 2? Post your questions here

Post » Thu Jun 23, 2016 3:24 pm

I have a turret that I copied i.e. instances (I believe). When bullet collides with turret I want text 1 x 1 to appear and on separate collision next turret 1 x 2 and so on. How do I do that? Thanks.
B
9
S
1
Posts: 9
Reputation: 503

Post » Fri Jun 24, 2016 8:47 pm

I don't fully understand your question.. but I'm guessing you may be looking for how to make a "counter".

Have a variable "counter", and on bullet collision with turret add one to "counter", then display text based on that variable (set text to "1 x "&counter)
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Tue Jun 28, 2016 8:56 am

Hi oosyrag, Thanks for your reply. Perhaps this will make it more clear. When the bullet hit the first turret a hidden text
"1 x 1 = 1" must be visible, second turret "1 x 2 = 2"............. Action > Text > Set visible - let all the text appear with the first bullet hit, that is not what I want. The text must be visible only on a hit of the specific turret. I managed to work around my problem with Opacity & a Timer but that means I can only show one turret at a time on the screen when my Window is set to 454, 280. Hope this makes more sense.
B
9
S
1
Posts: 9
Reputation: 503

Post » Tue Jun 28, 2016 4:45 pm

It sounds like you want to use containers.

Put the Text Object in a container with the Turret Object. When you create the Turret object, it will also create a Text Object that you can then set the text to.

The result of this is whenever that Turret Object is picked, such as On Bullet Collide with Turret, the associated Text Object will be picked as well, so you can do Set Text to Visible.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests