S
Silversea
Guest
Hi guys.
In a game I'm working on I want a special effect that appears to "trace" the outline of a sprite. I have a solution in mind but its missing one crucial piece, which is finding the point of collision.
My solution is having 3 objects. Object 1 is an empty object with a mask that uses the outline of the sprite. Object 2 is a collision object. Object 3 is a custom particle. The aim is for object 2 to rotate around its axis, and, when it collides with the outline of object 1, creates object 3 (particles). This creates the effect of tracing the sprite outline.
An image demonstration:
This solution makes sense to me, but I can't create the particles on the outline of the sprite without finding the point of collision. Ideally I'd run a check in the Collision event to find the (x,y) of collision, and create an instance of the particle object at that spot. But how do I find the (x,y) in the Collision event?
Any thoughts, or, alternatively, another non-complicated solution that reproduces this effect? Note that the shape of the sprite is not always same, so it needs to be a dynamic solution that works for any sprite shape within the size range.
I think there could there be a (potentially slow) method of using lengthdir_x and lengthdir_y, along with several loops of position_meeting. But that's a bit awkward.
(Note that there is no issue with having to isolate the sprite outline from the sprite itself -- it already is an outline to begin with!).
In a game I'm working on I want a special effect that appears to "trace" the outline of a sprite. I have a solution in mind but its missing one crucial piece, which is finding the point of collision.
My solution is having 3 objects. Object 1 is an empty object with a mask that uses the outline of the sprite. Object 2 is a collision object. Object 3 is a custom particle. The aim is for object 2 to rotate around its axis, and, when it collides with the outline of object 1, creates object 3 (particles). This creates the effect of tracing the sprite outline.
An image demonstration:
This solution makes sense to me, but I can't create the particles on the outline of the sprite without finding the point of collision. Ideally I'd run a check in the Collision event to find the (x,y) of collision, and create an instance of the particle object at that spot. But how do I find the (x,y) in the Collision event?
Any thoughts, or, alternatively, another non-complicated solution that reproduces this effect? Note that the shape of the sprite is not always same, so it needs to be a dynamic solution that works for any sprite shape within the size range.
I think there could there be a (potentially slow) method of using lengthdir_x and lengthdir_y, along with several loops of position_meeting. But that's a bit awkward.
(Note that there is no issue with having to isolate the sprite outline from the sprite itself -- it already is an outline to begin with!).
Last edited by a moderator: