How do I use a laser and mirror mechanic

0 favourites
  • 2 posts
From the Asset Store
This is a pack of 14 animated lasers with different colors.
  • Hi guys how would I be able to implement something like this?

    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. Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)