When enemy sprites are created I want them to fade in. When they are killed I want them to fade out and be destroyed.
I'm using the logic below, but seeing the following behavior:
- when I press 'i', the sprite instantly appears but doesn't fade in - why not?
- if I press 'o' within 2 seconds of pressing 'i', the sprite fades out and is destroyed - this is what I would expect
- if I press 'o' more than 2 seconds after pressing 'i', the sprite instantly disappears and is destroyed - why is it not fading out?
I'm obviously not understanding how to use fade properly, can someone clarify this for me, and/or let me know how to do what I'm trying to accomplish?
Thanks