How do I get a spherical transparent bubble effect

0 favourites
  • 4 posts
From the Asset Store
94 Inside buildings views - Isometric view - PNG transparent - 2048x2048
  • Hello;

    You know how a lazer burst hits the nearly transparent spherical shield of a space ship and it lights up for a few seconds and fades? Is there an effect combination that does this--it needs to take a radius (shield size) and an angle (where it was hit) and an intensity (so it can fade).

    Just wondering if someone knows an effect combo or something that can do this.

    Thanks for your time.



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One approach is to use two images, one for the faint Shield (full-circle 360° arc), and one for the bright Impact arc area on the Shield (say about a 90° arc of the circle).

    Making the images

    The key is that you create both images, the Shield and the Impact arc, so that they are the same size, and both with the hotspot at the center of the image.

    The easiest way to do this is to start by making both the Shield and the Impact image full circles. Each image should have its hotspot centered in the circle. Then for the Impact image, which is just a bright circle so far, we soft erase away everything but the right-most quarter of the circle, so that the result is a mostly blank image with a hotspot in the middle, and a bright quarter circle arc on the right edge of the image.

    Behaviors & Events

    Now if you snap both the Shield sprite and the Impact sprite to your ship, the Impact arc should line up perfectly with the right edge of the Shield bubble, as if the ship had been hit from the right. If you click the Impact sprite and grab the rotation handle, rotating the image should make the Impact arc slide around the edge of the Shield.

    Now to make it stick to the Shield bubble as the ship moves, and also fade out over time.

    For the Impact image, add the behaviors "Pin" and "Fade".

    In the event sheet create the following setup:

    When a projectile hits the Shield bubble:

    * Have the Shield spawn a new object, the Impact sprite. (The Impact sprite should automatically be centered on the Shield.)

    * Set the Impact sprite's angle towards an object, the projectile. (If you need to destroy the projectile, do it somewhere after this step.)

    * Pin the Impact sprite to the Shield. (This way when the ship moves, it won't leave the Impact sprite behind.)

    The fade will run automatically, and destroy the Impact sprite after fading out.

    Final optimization

    Finally, if you have everything working the way you want, you can crop the Impact sprite image using the crop button at the top of the image editor. This will cut the image size down to just the actually image area, and leave the hotspot in the correct relative position. Just a minor optimization.

    Hope that helps out.

  • Thanks fisholith. I can see how this will do it--but I was thinking about an effect like bubble but with a directional highlight of some kind. I think your method is the brute force method, but sometimes that is best.



  • great suggestion fisholith

    although this assumes your shield is circular right? if you had oblong shields (like in star trek) you'd probably need to do some sort of animation frame swapping..

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