How do I make a laser/beam/flame/whatever "barrier"

Get help using Construct 2

Post » Mon Oct 24, 2016 9:56 pm

I'm making a few turrets with different behaviours and abilities.

I want one of the turrets to spawn a beam that acts as a barrier for a small amout of time and then disapears. How can I achieve this? I attach a small mockup of the desired effect

Image

I tried using bullets with different animations but I can't get it to work nicely. Any tips?
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Mon Oct 24, 2016 10:31 pm

You could potentially just make the laser beam a part of the turret. Have a default animation and a shooting animation with the beam, and switch between them as needed.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Mon Oct 24, 2016 10:46 pm

Sup with that? wrote:You could potentially just make the laser beam a part of the turret. Have a default animation and a shooting animation with the beam, and switch between them as needed.


Yeah but if I have different heights for the turret placing it won't look good.
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Mon Oct 24, 2016 10:58 pm

You could have shooting animations for every possible height :P

Nah, what else you can do is have a laser beam object together with every turret and toggle its visibility on/off when it's time to shoot. Then you can adjust the height of the laser so it stretches from the floor to the turret.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Tue Oct 25, 2016 7:32 am

Sup with that? wrote:You could have shooting animations for every possible height :P

Nah, what else you can do is have a laser beam object together with every turret and toggle its visibility on/off when it's time to shoot. Then you can adjust the height of the laser so it stretches from the floor to the turret.


Could possibly work but feels a bit sketchy I would need a better way to make it work
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Tue Oct 25, 2016 8:38 am

Seems like the most flexible method to me tbh. Did you have something particular in mind that wouldn't work with it?
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Tue Oct 25, 2016 8:46 am

Sup with that? wrote:Seems like the most flexible method to me tbh. Did you have something particular in mind that wouldn't work with it?


You can't stretch animations as you please. They have a height and width for a reason
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Tue Oct 25, 2016 8:55 am

Smileh wrote:
Sup with that? wrote:Seems like the most flexible method to me tbh. Did you have something particular in mind that wouldn't work with it?


You can't stretch animations as you please. They have a height and width for a reason



man this was a fast disproved point...... yes you can stretch it as you wish, that is why is a image. and can also look good, depends on how you create your graphics, you can use also not a regular sprite, but a tiledbackground for the frame of the laser to repeat itself in length or width, however tiledbackgrounds dont have frames, so im using sprites cause its more useful.


Demo capx enjoy it :) <--- has animation in it also multiple frames.


if you want the beam to stop a platformer, just add the behavior Solid to it, and will be working as long as its on screen and blocks the blobs path.
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,960

Post » Tue Oct 25, 2016 9:04 am

gamecorpstudio wrote:
Smileh wrote:
Sup with that? wrote:Seems like the most flexible method to me tbh. Did you have something particular in mind that wouldn't work with it?


You can't stretch animations as you please. They have a height and width for a reason



man this was a fast disproved point...... yes you can stretch it as you wish, that is why is a image. and can also look good, depends on how you create your graphics, you can use also not a regular sprite, but a tiledbackground for the frame of the laser to repeat itself in length or width, however tiledbackgrounds dont have frames, so im using sprites cause its more useful.


Demo capx enjoy it :) <--- has animation in it also multiple frames.


if you want the beam to stop a platformer, just add the behavior Solid to it, and will be working as long as its on screen and blocks the blobs path.


If I use a tiledbackground I can't animate it, that's the problem. If I make a sprite I can't stretch it and make it look good. There would be way too many different heights and positions
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Tue Oct 25, 2016 9:18 am

Even a sprite should hold up pretty well to stretching in this case. You can make the laser sprite e.g. a 10 x 10 pixel box with a horizontal gradient. That way, since you're only stretching it vertically, the gradient should remain consistent without getting diluted or some such.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, ignaciosimo, nickar and 43 guests