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

0 favourites
From the Asset Store
A scorching package of 102 professional-quality sound effects for flames, fire ambience, fire magic and more.
  • 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

    I tried using bullets with different animations but I can't get it to work nicely. Any tips?

  • 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.

  • 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.

  • You could have shooting animations for every possible height

    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.

  • You could have shooting animations for every possible height

    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

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

  • 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

  • > 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.

  • >

    > > 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

    It really depends on how you create the sprite, for the idea I had in mind I'm absolutly positive that the stretching sadly wont work, specially for the animation I wanted to create. Specially for the fire laser.

  • Smileh did you tried the capx? just follow the pattern for the sprite. and all your problems will be fixed.

  • Smileh did you tried the capx? just follow the pattern for the sprite. and all your problems will be fixed.

    I couldn't. Dont have the beta installed.

  • 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

    You can animate a tilemap. Just set the tiles in region to tick % n .. where n = count of frames (as tiles).

  • > Smileh did you tried the capx? just follow the pattern for the sprite. and all your problems will be fixed.

    >

    I couldn't. Dont have the beta installed.

    but i used r238 beta, stable is r239 you should be able to open it. unless you use some very old stable version in which case i dont want to help for various reasons.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)