Automatic Fire?

Just started using Construct 2? Post your questions here

Post » Thu May 07, 2015 1:26 am

Hello, I'm making a top-down shooter and am trying to have the character shoot a fully automatic weapon instead of having to click for every shot. I want to be able to hold down left mouse button to shoot the weapon at a certain pace.

I've tried : Event : Mouse : Left mouse is held down : Action : System : wait 0.2 seconds
Action : 'Commando' : spawn object : bullet

Unfortunately, this only created a delay for the time before the 'Commando' starts firing. It want the player to be able to hold down left-click and be able to shoot, say, 1 bullet per 0.2 seconds.

Help?
B
28
S
11
G
4
Posts: 77
Reputation: 4,321

Post » Thu May 07, 2015 5:44 am

ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721


Post » Sat May 09, 2015 5:23 pm

Thanks a lot for the feedback, but I've run into another similar problem. This time I have an enemy that spits acid at you but I can't seem to find a way to make them shoot independently at a constant rate. I've tried timers but I'm not sure if I did them right so now I'm using System : Every 1.0 seconds + Sprite : Is on screen and the action Sprite : spawn spit to make them fire. The problem is that they all shoot at the same time :|.

Help? A contruct 2 example would be SO helpful. Thank you!
B
28
S
11
G
4
Posts: 77
Reputation: 4,321

Post » Sat Jul 04, 2015 6:23 pm

Maybe this is something you can use :) @PrimalNews

Code
Image

Example The reason they all turn is because the range is so high.
Image

Capx
Acid Sprayers
B
16
S
8
G
1
Posts: 153
Reputation: 2,549


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest