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
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

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
44
S
13
G
7
Posts: 338
Reputation: 10,379

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
8
G
7
Posts: 756
Reputation: 7,192

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
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Thu Mar 14, 2013 1:53 pm

@vee41

Excellent ! thanks a lot for taking your time to help
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

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
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Thu Mar 14, 2013 2:15 pm

@ramones

Nice example too, thanks.

Just makes me realise how inadequate my skills are
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013


Return to How do I....?

Who is online

Users browsing this forum: Kagubro and 32 guests