Best way to make a slow laser?

For questions about using Classic.

Post » Sun Dec 13, 2009 8:41 am

Like these: http://www.youtube.com/watch?v=sd95jQ57_eM#t=0m27s

They shoot out, but don't instantly create a line from the start wherever the end is. The laser keeps moving until it hits a wall. And if something gets in front of it, the laser stops moving wherever the new wall is.
B
3
G
3
Posts: 12
Reputation: 1,224

Post » Sun Dec 13, 2009 4:35 pm

What methods have you tried so far?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Dec 13, 2009 7:55 pm

[quote="deadeye":2xs01m98]What methods have you tried so far?[/quote:2xs01m98]

This is what I got: http://dl.dropbox.com/u/3314752/lasers.cap

It works fine when there's just one laser shooter, for the most part. But all the weirdness happens when there is two or more because some segments move to the other line instead of staying where it should be.
B
3
G
3
Posts: 12
Reputation: 1,224

Post » Sun Dec 13, 2009 9:39 pm

You should only check for collision with a special object that goes at the tip of the laser.

Also, you could use the RTS behavior to drive the laser tip, so you'd launch it at an angle and it would always home in on its target.... have it leave trails with the fade behavior.

I would do an example, but I FAIL to get RTS behavior to even go somewhere :s
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Dec 13, 2009 11:36 pm

Your instances were getting confused because you weren't specifying which gun sprites belonged to which laser sprites.

I added a couple of For Each loops and a PV called 'gun' to keep track of which laser sprites belong to which gun.

The guns are labeled 1 and 2 (check their properties), and when they spawn a laser the laser gets tagged with the same number. That way when you tell the laser parts to line up their .Y location with a gun later on, they know which gun to line up with.

http://www.box.net/shared/hv4a8jp4iv

It works fine now.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Dec 14, 2009 1:34 am

Yeah, that could end up being a cool effect.

However, I want you to take note of this:



Hope everything works out!
B
4
S
1
G
5
Posts: 98
Reputation: 1,648


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests