[behavior] rex_light

Post your completed addons to share with the community

Post » Tue May 20, 2014 7:09 am

@Johncw87 's trace (raycast) plugin is better then this behavior. So I will recommend user try that plugin first.

Here is the demo of reflecting using trace (raycast) plugin. (source capx)




----



rex_light : adjust width until hit obstacle (not a real lighting system)

Demo1: lights and reflection ( laser)
Demo2 : project shadow ( left/right/up arrowkey to move the character)
Last edited by rexrainbow on Mon May 09, 2016 6:32 am, edited 4 times in total.
B
108
S
26
G
272
Posts: 4,473
Reputation: 152,281

Post » Sun Aug 31, 2014 11:32 am

Thank you so much, this is gonna be useful when making lasers for a game :D
B
22
S
6
Posts: 244
Reputation: 2,690

Post » Thu Sep 11, 2014 9:50 pm

Another thank you for sharing this & all your other c2 addons.

I just wanted to confirm something about this behavior- does ReflectionAngle only work for the sides of a sprite that are parallel to the sprite's angle?

Image
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Fri Sep 12, 2014 7:19 am

@mattb

The parameter of expression:ReflectionAngle is the normal vector. I only use the angle of the wall to be this input, so that it might be strange at the edge of wall, like your image 2 shown.
B
108
S
26
G
272
Posts: 4,473
Reputation: 152,281

Post » Sun Sep 14, 2014 8:43 am

After spending about 2 days figuring out how to make lasers and bullet-tracers, I find this excellent plugin that does it better (significantly faster according to the debug mode) and far simpler.

However, I wonder if I might request a feature. Is it possible to exclude certain instances from the collision triggers? The player unit and his allies as well as enemies all have Shields. I was hoping the light behavior could ignore collision with all instances of the Shield object belonging to the attacker and his allies.

The way I did it before was to save the attacker's UID and faction name in the laser/tracer's instance variables then make the laser/tracer ignore shields and allies of the same uid/faction. Basically, the laser/tracer would ignore collisions with objects from the same source.
B
13
S
3
Posts: 17
Reputation: 984

Post » Sun Sep 14, 2014 4:43 pm

@Norbingel

Set the collision of ignored objects to "Disable", so that they will not be tested.
B
108
S
26
G
272
Posts: 4,473
Reputation: 152,281

Post » Mon Sep 15, 2014 6:46 am

@Kyatric

Please help me move this thread to "Completed Addons" section.
B
108
S
26
G
272
Posts: 4,473
Reputation: 152,281

Post » Mon Sep 15, 2014 10:47 am

Moved.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,297
Reputation: 70,799

Post » Mon Sep 15, 2014 10:51 am

@Kyatric

Thanks!
B
108
S
26
G
272
Posts: 4,473
Reputation: 152,281

Post » Tue Sep 16, 2014 9:43 am

@rexrainbow

I don't think it'll work. I need the unit's shields to allow it's own laser through, but block enemy lasers so I can't disable collision. If it could ignore checks for certain instances only, instead of all objects of the same type, that would do it, I think. It's what my laser is doing now but testing shows your plugin is significantly faster (not to mention a whole lot easier to do).
B
13
S
3
Posts: 17
Reputation: 984

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests