How do I get a spherical transparent bubble effect

Get help using Construct 2

Post » Fri Aug 14, 2015 2:28 pm

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.
yours
winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305

Post » Fri Aug 14, 2015 3:58 pm

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. :)
B
27
S
18
G
8
Posts: 327
Reputation: 6,154

Post » Fri Aug 14, 2015 4:57 pm

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.

yours
winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305

Post » Thu Sep 17, 2015 3:50 pm

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..
B
96
S
31
G
15
Posts: 1,180
Reputation: 16,017


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 22 guests