How do I use a laser and mirror mechanic

Get help using Construct 2

Post » Wed Aug 30, 2017 3:36 pm

Hi guys how would I be able to implement something like this? Image I have the rotating mirror mechanic but I just dont know how to implement the laser and how the mirror would change the direction please help. :cry: Thanks
Image
B
29
S
15
G
12
Posts: 312
Reputation: 9,664

Post » Thu Aug 31, 2017 7:02 pm

This is one simple option:
(You can see a rough attempt here: https://1drv.ms/u/s!AnY-pqlx8I0corNwcNqX0TBypeWvpA )
1- You can use bullet to give movement to the sprite that represents your laser.
2- Then create the mirror sprites and modify the collision polygon to fit the shape.
3- Add an instance variable to the mirrors. This variable, let's call it bounceAngle, indicates the angle that the laser should take after the collision.

4- Then add an event that deals with the collision between the laser and the mirror.
The action should be: Set Angle of Laser to Mirror.bounceAngle

You got it.

In the example .capx I added another evewt that changes the orientation and bounceAngle of a mirror when touched, but this can be modified to match the mechanic you are looking for.

I hope this helps. I may check how to use this sample in one game of my own.
B
57
S
11
G
2
Posts: 35
Reputation: 7,468


Return to How do I....?

Who is online

Users browsing this forum: tannerdler and 23 guests