Muzzle flash [SOLVED]

For questions about using Classic.

Post » Sat Mar 26, 2011 8:11 pm

Hello!

I recently dug up Construct because the urge to create a top-down zombie game that would be better than Zombie Horde 3 was too much for me to bear. :D

I quickly ran into a problem tough... how do you create decent muzzle-flash? Currently I have a animated (2 frames) sprite, which I create together with each bullet fired from the player-sprite. But how do I delete the sprite afterwards, because at the moment it just stays there indefinitely... I tried to destroy it after the animation has ended, but that didn't impress it a bit.

I'm sort of stuck here, any help ... please? :?

Best regards,
Noel
B
3
G
2
Posts: 35
Reputation: 770

Post » Sat Mar 26, 2011 8:24 pm

Is the sprite's animation set to loop? If it is, the animation won't "end", so to speak, so the way you set it up right now it'll never destroy itself. Sooo, try unchecking "Loop" ;)
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sun Mar 27, 2011 2:04 am

If your still stuck, you can use these-

[url:3ue9iofl]http://dl.dropbox.com/u/22173473/muzzle.rar[/url:3ue9iofl]



It contains 3 PNG images with transparency and instructions.

I made them for a shooting game i am working on.

[u:3ue9iofl]I used these events -[/u:3ue9iofl]

[color=#000080:3ue9iofl]Line 7 + MouseKeyboard: On Left mouse button Clicked
-> System: Create object muzzleflash on layer 2 at (gun.X-6, gun.Y-20)


Line 8 + muzzleflash: Any animation finished
-> muzzleflash: Destroy

The animation settings were -

Animation speed 50
Loop OFF
Repeat # 2
Repeat to 1
Ping-pong OFF[/color:3ue9iofl]


if you want to download the game cap (you can copy them out of the cap) go here-

[url:3ue9iofl]http://www.scirra.com/forum/viewtopic.php?f=4&t=8778#p67345[/url:3ue9iofl]

Feel free to use them if they want.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Mar 27, 2011 4:58 am

Thanks, SullyTheStrange... that was a perfect guess. I forgot to set the animation not be looped. That easy. Works perfect now.

Thanks also chrisbrobs, very good to see that I was doing it right, basically (comparing with your event-list). I want to create all FX and visuals myself though... :)

Best regards,
Noel
B
3
G
2
Posts: 35
Reputation: 770


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests