Laser

Get help using Construct 2

Post » Mon Feb 04, 2013 10:43 pm

@CrudeMik Did you try putting the laser in a container with the enemy?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Feb 04, 2013 11:32 pm

ooh, I have not. I keep forgetting to learn about containers! Thanks
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sat Mar 14, 2015 6:53 pm

@sqiddster I don't suppose you still have this do you? The dropbox link is broken. I have the version @R0J0hound created set up, but notice that it's doing around 400 collision checks a tick.

I plan on having 4 characters running around with these lasers, so I'm interested in checking out the other method to see if it produces less checks.

I tried recreating it using what you've described in your post, but don't see where the increment variable is reset. As far as I can tell, it just reduces down to 1 and then stops.

I know we're now 3-4 years down the line... :(
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 931
Reputation: 9,360

Post » Sat Mar 14, 2015 8:10 pm

Maybe this one can help?
You do not have the required permissions to view the files attached to this post.
B
20
S
5
G
2
Posts: 175
Reputation: 3,462

Post » Sat Mar 14, 2015 10:37 pm

@AnD4d Hey, yeah, I just cleared out my Dropbox recently. Had to happen eventually, I'm afraid.

Anyway, I actually have a much improved version! Lightning-fast raycasting
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Mar 16, 2015 7:12 pm

Great stuff! Thanks a lot! Took collision checks down from 300 to just 30 :)
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 931
Reputation: 9,360

Post » Sun Jul 26, 2015 12:08 am

@sqiddster Sorry to bump this again, but I'm working on your example, trying to get multiple lasers working at once. I can see earlier than you mention this in regards to applying it to containers, but that looks like it may be referring to an old one.

I downloaded your capx and simply added in another ray. Only the original appears to be affected by the code, and I can't figure out why. Any chance of some extra help on that?

*edit - saying that, it looks like replacing the Pick - Function.Param(0) with a for each does the job. Just not sure what the knock on effect will be.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 931
Reputation: 9,360

Post » Sun Jul 26, 2015 1:11 am

@AnD4D The function applies for only one laser, I believe it has a laser UID as a parameter. so if you want it to affect all the lasers, use a for each loop, and call the function with laser.uid inside the loop.

Putting a for each inside the function will work too, but you'll lose the ability to use it for just one laser at a time.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Oct 25, 2015 6:22 am

How to make the laser bounce off of the surfaces?

thanks,
B
85
S
31
G
23
Posts: 384
Reputation: 19,092

Previous

Return to How do I....?

Who is online

Users browsing this forum: SpartCrafter and 26 guests