Creating a autofire

Game Editor comments and discussion.

Creating a autofire

Postby HillBilly » Sun Aug 20, 2006 2:13 pm

This is probably. some thing simple I am over looking.

What I want to do is create a autofire with a pause between shots.
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score

Postby makslane » Sun Aug 20, 2006 2:15 pm

1) Create an timer on Key Down
2) On Timer event, create the shot actor
3) On Key Up, destroy the timer
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby HillBilly » Sun Aug 20, 2006 2:32 pm

Thanks Makslane. I new it was something simple. I was making it to hard as usual. :lol:
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score

Postby makslane » Sun Aug 20, 2006 2:53 pm

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.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Creating a autofire

Postby Zivouhr » Fri May 08, 2015 3:03 am

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
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest