Hello,
I am happily and steadily progressing in my project. My last addition is a laser effect. The animation works this way: there is a wind up charge, then the laser itself, and finally some remaining particles. The animation is handled by various gtweens with delays to appear more or so after each other.
I am currently investigating ways to handle collisions. The problem is the laser is added to stage and appears with a delay. This is why the collision is validated before the laser appears. My last idea is to use:
if laserEffect:getAlpha() > whateverValue then testCollision() end |
But I wonder if you guys ran in similar problems, and what strategy did you use?
Bonus: the effect itself.
Comments
It seems my explanation was bad.
I have no problem to remove the sprite. In fact I already use this code snippet for each element of this animation.
The laser effect last 1.6 sec. And starts to appear 1.4 sec after the start of the animation.
My concern is the best way to handle collision, knowing the sprite exists on stage before appearing on screen.
I plan to use the sprite's alpha as a landmark (like mentioned in the OP) but I wonder if there are better ways to achieve this.
Can't you test the collisions here?
Likes: MoKaLux