Making a laser

Get help using Construct 2

Post » Tue Aug 13, 2013 6:34 pm

I thought of that and even played with that idea before. And while that works, the laser (now) goes through the target object and out the other side of it, so it looks a little weird. If it stopped at it's center your idea would be perfect :)

The laser beam has to "collide" with the obstacle sprite though. There's no getting around that in my particular game. =\
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Tue Aug 13, 2013 7:08 pm

Change the Set laser width in the Else event (#5) to
min(self.Width + self.increment,distance(laser.X,laser.Y,target.X,target.Y))
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Tue Aug 13, 2013 7:31 pm

Gosh Paradox, I could hug you right now...thanks so, so much! :D

I only know a few expressions so far. distance, angle etc. I never saw that one. I'll remember it for any future use.

Really, thanks everyone for your help. That was a problem that's been at me for a while now. I never would have figured that out if it weren't for all your help.
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Wed Aug 14, 2013 2:26 am

@Kazan to make it hit the target as well, all you have to do is add a family - instead of checking for collision with the 'obstacle', check for collision with the family. Then, just add the obstacle AND the target to that family.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,689

Post » Wed Aug 14, 2013 9:11 am

@sqiddster

Yeah I meant to say thank you for the family idea as well. I haven't given those a lot of attention yet. That will make this and a lot of other things a heck of a lot easier.

Thanks again :)
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Wed Aug 14, 2013 3:06 pm

No problem, glad I could help!
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,689

Previous

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo, Euduardo, Jackriduk, Yahoo [Bot] and 31 guests