[behavior] rex_light

Post your completed addons to share with the community

Post » Tue Sep 16, 2014 10:07 am

@Norbingel

Since the checking is not automatically, you could disable the collision of target instance only, then run action, finally reset collision to enable.

Edit: to mark the ignored instances, you might use my rex_ginstgroup plugin.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Tue Sep 16, 2014 4:58 pm

I will test later when I can but when I enable collision again, wouldn't it detect the collision again and set the laser length accordingly? What happens when the enemy laser is hitting the shield at the moment I disable collision? Then the laser would get through when it shouldn't.

That looks like another handy plugin, thanks! :D
B
13
S
3
Posts: 17
Reputation: 984

Post » Thu Sep 25, 2014 11:59 pm

rexrainbow wrote:@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.


So if I wanted to get correct reflections on all sides of a rectangular sprite, the way to do this would be:

1. determine which side of the sprite is hit (by comparing the angle between sprite & hit point)

2. for the 2 sides of the sprite with incorrect reflection, set the reflected angle of a Laser sprite to 'Laser.Light.ReflectionAngle(Sprite.Angle+90)'

Is this right?


(I've tried to set this up & I think my code for step 1 is faulty, but just wanted to confirm that I'm on the right track)
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Fri Sep 26, 2014 2:43 am

@mattb

I guess... you might use 4 edges (sprite) to compose a full wall. Each edge maintains a face of reflection.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Sun Sep 28, 2014 5:43 pm

Got the events working at last. Capx is attached below...

Image
You do not have the required permissions to view the files attached to this post.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Mon Sep 29, 2014 2:56 am

@mattb

Beautiful demo.
Could I add this export result into my public demo list? And add this sample capx in my document page?
I will add your name (mattb) at the left-down side.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Mon Sep 29, 2014 3:10 am

@rexrainbow how to download this plugin ?
~Everyone can make GAMEs~
B
55
S
11
G
1
Posts: 414
Reputation: 5,786

Post » Mon Sep 29, 2014 3:48 am

@Hardty

The most easy way is using this tool. Or check the document of this behavior.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Mon Sep 29, 2014 9:47 pm

@rexrainbow - please do :) Here's a version with better textures & opacity falloff...

Image
You do not have the required permissions to view the files attached to this post.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Tue Sep 30, 2014 5:36 am

@mattb

Thanks. I had put your demo capx into the document of this behavior.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests