Laser picking problem

Get help using Construct 2

Post » Thu Mar 14, 2013 12:32 pm

Hi

here is the capx (r122) Laser Problem

As it stands it works as i want. Move the door up and down with the arrow keys and spawn a block with the left mouse button.

What i can figure out is how i can clone the Laser and Laser switch and have it operate the same way as the first.

I need multiple lasers on one level.

I know its a picking problem but i cant see where i do the picking.

Alternative solutions welcome

Thanks for your time.
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Thu Mar 14, 2013 1:14 pm

What exactly is the desired result? Do you want the lasers to shoot straight, endlessly, until they run into an obstacle, or do you want a 1 to 1 relationship , where each laser aims for a specific switch?
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Thu Mar 14, 2013 1:41 pm

This might work for you: Lazor beams example

Cleaned things up a bit, you don't need 'run every dt' conditions for anything really. Things run every tick by default unless you define otherwise :)
B
24
S
9
G
7
Posts: 756
Reputation: 7,302

Post » Thu Mar 14, 2013 1:47 pm

@zatyka

Hi, i want multiple lasers to act as the one in the example. In other words each laser hits its own switch, and is interrupted by a door or block.
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Thu Mar 14, 2013 1:53 pm

@vee41

Excellent ! thanks a lot for taking your time to help
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Thu Mar 14, 2013 1:56 pm

All you need is to give the laserbeams and switches matching id variables and then have 'for each laserbeam', pick matching laserswitch, do your thing. I ended up making a few other changes though.

lasers.capx (r122)
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Thu Mar 14, 2013 2:15 pm

@ramones

Nice example too, thanks.

Just makes me realise how inadequate my skills are
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo and 24 guests