Need help with light effects

Get help using Construct 2

Post » Sat Jun 02, 2012 2:21 pm

EDIT: PLEASE READ RECOND POST FOR WHAT I WANT TO ACHIEVE WITHOUT READING THIS WALL OF TEXT!

Recently, I've decided to put light effects in my game, so, I've made a layer with a black background, and put some elements in it with the "Destination out" effect to do the light effects. But of course, the light effects go over everything, including walls, and I wanted to change that, at least with walls, so the player can't see what's on the rooms except on the room he's at.

After some hard thinking, instead of the player having a "cone of light", I've decided to changed to 13 lines, all following the mouse, but each with a sligthly different angle. And, when it collides with the walls, it changes it's size, if it collides with a vertical platform, I use a certain formula, if it's a horizontal one, another formula, and if it's not colliding with any of the walls, it goes to it's original size.

My game
My capx

It works well, but I'm having trouble whenever you're looking from the side of a horizontal platform or looking to the top/bottom of a vertical platform.


I need help figuring out a way to fix the above error or to change how the light effects works at all!




samgamgi2012-06-04 17:19:44
B
7
Posts: 12
Reputation: 800

Post » Mon Jun 04, 2012 5:08 pm

Ok, after some searching, I think I found an example of what I want to do, so, maybe, someone will be able to help me now...

Can't turn it off

I want to make that laser. But without the "reflective" gimmick. I want it to hit a wall and stop, not getting past it or anything.

So...ideas?

EDIT: Sorry, after 10 minutes I posted this, I found something that should work. If anyone is interested in the solution, it's in this post.
Lazors
And if you think you have a better solution, I'm all ears.

For those that actually read my whole post and even tried to think something of something, thank you. samgamgi2012-06-04 17:17:58
B
7
Posts: 12
Reputation: 800

Post » Mon Jun 04, 2012 5:18 pm

R0J0hound helped me out with reflective lasers some time ago, maybe this example can help you too?

Scirra Forum Thread LinkNimtrix2012-06-04 17:18:38
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Mon Jun 04, 2012 5:21 pm

Heh, thank you! I found a post similar to yours, where R0J0hound sent the same capx to the topic creator. I'll get that light up and running as soon as I can!
B
7
Posts: 12
Reputation: 800

Post » Tue Jun 05, 2012 12:08 am

Here's an example of the current system that I'm using in Can't Turn it Off:

Ray Cast Example
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Sat Jun 16, 2012 3:12 am

Wow, from the man himself! Thank you, dude, that should help a lot!
B
7
Posts: 12
Reputation: 800


Return to How do I....?

Who is online

Users browsing this forum: ManuelPerez and 21 guests