Reflecting laser beams off surfaces

Get help using Construct 2

Post » Wed Nov 02, 2016 7:16 am

Message: Ken95 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://www.dropbox.com/s/cx2l2ex8p31n6 ... .capx?dl=0

here is my capx mr r0j0hound.
there are two laser machines that produces the laser beam.
the problem is that only one of the laser machines produces the beams.
would you please fix my event sheet so that it produces 2 laser beam with each has its own reflecting properties. O would be glad if i fixed that problem. Thanks in advance
B
9
S
1
Posts: 26
Reputation: 479

Post » Mon Nov 07, 2016 12:34 pm

Message: Ken95 can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
R0J0hound wrote:@Ken95
The process? It's basically just finding the intersection between lines a bunch of times. The objects have a border made up of lines and the ray is a line. You can just place the lines of the objects manually or use math to place them.

It finds all the lines that intersect the ray, then uses the intersection closest to the start of the ray. From there you can calculate the normal of where the lines intersect and in turn calculate the reflection angle. Then it's just a matter of setting the ray to be from the intersection going at the reflection angle and repeating the process a number of times.

The calculating of the line intersections and reflection angles is easily found in a search engine.



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

here is my capx mr r0j0hound. https://www.dropbox.com/s/cx2l2ex8p31n6 ... .capx?dl=0
there are two laser machines that produces the laser beam.
the problem is that only one of the laser machines produces the beams.
would you please fix my event sheet so that it produces 2 laser beam with each has its own reflecting properties. O would be glad if i fixed that problem. Thanks in advance
B
9
S
1
Posts: 26
Reputation: 479

Post » Mon Nov 07, 2016 12:45 pm

@Ken95

If you are trying to attract the attention of a user, you need to preface the user name with the "@" sign, as I have done to attract your attention.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
87
Posts: 5,490
Reputation: 60,266

Post » Mon Nov 07, 2016 6:28 pm

@Ken95

I won't have time to look at your capx, but if it's only working for one laser then you need to repeat the actions for the other lasers. A loop would be useful.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Tue Nov 08, 2016 6:54 am

@R0J0hound
I have already done it but the produced laser will be on the exact same place as the first one
B
9
S
1
Posts: 26
Reputation: 479

Post » Tue Nov 08, 2016 7:43 am

True. You need to change the Ray for the second iteration. Probably a "for each laser" instead of the repeat so that each Ray could be used.

As a rough overview it's kind of like this:

For each laser
---"set Ray" to laser
--- for each wall
------ "cast to" wall
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests