How do I Make something stop at a solid?

Get help using Construct 2

Post » Fri Jun 12, 2015 4:18 pm

One of the players in my game shoots a laser beam, but when it hits a block it goes right through it.
How could I make it invisible under the block?
I've already thought of moving to bottom of layer, but then it could still show depending on how I made the level.
Thanks :P
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150

Post » Fri Jun 12, 2015 4:59 pm

Hi Lucky Star,

Have you tired adding an event for the laser beam hitting the block? (Actually it does sound like you have). You could then either set the laser beams opacity to zero, set it as invisible, or just destroy it!

Hope that helps :)
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Fri Jun 12, 2015 5:20 pm

@TMAJA I mean I want it to, well, its a bit hard to explain, lets say you stuck a laser beam at a wall, it wouldnt dissapear, it wouldnt shoot through the wall, it would just kind of deflect, heres an image example : http://sclick.net/cool%20gadgets/cooles ... er-gun.jpg
It just cuts the part that would be going through the wall off.
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150

Post » Fri Jun 12, 2015 6:01 pm

Raycasting would work perfect for this.
Here's a helpful capx by @sqiddster, which should get you going in the right direction. https://www.scirra.com/tutorials/902/li ... raycasting
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Fri Jun 12, 2015 6:54 pm

you can make the laser beam length not be greater then distance from original point of creation towards x y of the enemy, so if it hits the enemy its going to stop to its center position as length, if enemy will come towards you or go away the laser will grow bigger or shrink!

wep x,y is the original point of the laser from the weapon i guess if u have any!
set width distance(wep.x,wep.y,enemy.x,enemy.y) see if that helps

if u have enemys and solids in one familly you can switch enemy.x,y to familly name .x ,y
B
78
S
23
G
69
Posts: 1,353
Reputation: 43,985

Post » Fri Jun 12, 2015 8:55 pm

@ryanrybot Squiddster's tutorial for some reason didn't work..
And everyone, note that this game is going to be a PUZZLE game with no enemies ( @gamecorpstudio ), and it will look like a platformer, for instance there will be a ground and a wall to shoot.
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150

Post » Sat Jun 13, 2015 12:53 am

SOLVED
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150


Return to How do I....?

Who is online

Users browsing this forum: Kin and 41 guests