Page 1 of 1

Creating a autofire

PostPosted: Sun Aug 20, 2006 2:13 pm
by HillBilly
This is probably. some thing simple I am over looking.

What I want to do is create a autofire with a pause between shots.

PostPosted: Sun Aug 20, 2006 2:15 pm
by makslane
1) Create an timer on Key Down
2) On Timer event, create the shot actor
3) On Key Up, destroy the timer

PostPosted: Sun Aug 20, 2006 2:32 pm
by HillBilly
Thanks Makslane. I new it was something simple. I was making it to hard as usual. :lol:

PostPosted: Sun Aug 20, 2006 2:53 pm
by makslane
Make the shoot actor control yourself.

1) In 'Create Actor' event set the shot direction. You can use xvelocity, yvelocity, paths...
2) Destroy the shot when to avoid hundreds of useless actors in the game. You can use the 'Out of Vision' to destroy the shot.

Re: Creating a autofire

PostPosted: Fri May 08, 2015 3:03 am
by Zivouhr
Good tips.
To hold the key down to fire, but not release a constant stream of bullets, this works, though I'll have to test it against walls. Actually, now that I tested it, looks like the "Out of vision" is doing all the code work... Still need to figure out how to hold down the fire button but not release a stream of bullets all at once almost.

Very basic, 2 minute test of autofire. Spacebar to fire.
bulletautofirelimit.ged
(1.39 KiB) Downloaded 112 times