How to implement soft edge areas with particles

Posted by OpherV on Game Development See other posts from Game Development or by OpherV
Published on 2014-05-30T09:49:35Z Indexed on 2014/05/30 16:07 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

My game is created using Phaser, but the question itself is engine-agnostic.

In my game I have several environments, essentially polygonal areas that player characters can move into and be affected by. For example ice, fire, poison etc' The graphic element of these areas is the color filled polygon area itself, and particles of the suitable type (in this example ice shards). This is how I'm currently implementing this - with a polygon mask covering a tilesprite with the particle pattern:

enter image description here

The hard edge looks bad. I'd like to improve by doing two things: 1. Making the polygon fill area to have a soft edge, and blend into the background. 2. Have some of the shards go out of the polygon area, so that they are not cut in the middle and the area doesn't have a straight line

for example (mockup):

enter image description here

I think 1 can be achieved with blurring the polygon, but I'm not sure how to go about with 2.

How would you go about implementing this?

© Game Development or respective owner

Related posts about 2d

Related posts about graphics