Top-down shotgun spread?

Get help using Construct 2

Post » Fri Jul 24, 2015 4:23 pm

Hello, I'm making a game called Pixel Carnage and I'm creating a shotgun character. One problem I'm running into is how to make the shotgun shoot multiple bullets in a spread while keeping the same image point.

Also, if possible, could any of you kind people tell me how to randomize the spread? Or would that require more image points etc.?

Thank you for helping, the best reply someone gives me will go towards the honorable mentions of my credits.
B
28
S
11
G
4
Posts: 77
Reputation: 4,321

Post » Fri Jul 24, 2015 4:44 pm

If you are simulating a shotgun spread fire, you don't need multiple image points. Just give the bullet a "bullet" behavior, than on created, adjust some of their angles to give the spread out formation. You could use the "random" code to give it slight variations.
B
45
S
23
G
31
Posts: 693
Reputation: 20,612

Post » Sat Jul 25, 2015 2:02 am

rekjl wrote:If you are simulating a shotgun spread fire, you don't need multiple image points. Just give the bullet a "bullet" behavior, than on created, adjust some of their angles to give the spread out formation. You could use the "random" code to give it slight variations.


Thanks a lot rekjl!
B
28
S
11
G
4
Posts: 77
Reputation: 4,321

Post » Sun Jul 26, 2015 1:12 pm

what rekjl said its true but then most of the bullets spawned wold have the same amount of angle so wold overlap, you could spawn 3 bullets and give for each spawned bullet an angle for example action for bullet 1 lets say its middle create actorbullet. set angle to player angle, then the left wold be like this create actorbullet. set angle to playerangle-45 and then for right same as left but instead of minus set to + and there you go a shotgun spread bullet in 3 directions without the bullets overlapping in same angle ever.

also for each bullet you can set a everytick or under each angle change another action telling to change the direction of movement towards the current angle they are facing. that wold be something like everytick or under the creation of each actorbullet line .... actorbullet>bullet>angleofmotion set : to self.angle

and if u want the bullets not to go to far, just make a condition check for distance traveled and say smth similar to this actorbullet>traveled >200 px action>destroy...

actorbullet>oncollision with walls
or

actorbullet>oncollision with enemy


destroy


here is a simple capx filedownload the link doesn't work anymore.. seems the files got deleted from filedropper servers.. il try re-upload them somewhere else if necessarily
Last edited by gamecorpstudio on Wed Aug 12, 2015 12:48 am, edited 1 time in total.
B
75
S
22
G
68
Posts: 1,337
Reputation: 43,271

Post » Mon Aug 10, 2015 2:37 pm

I used particles for my shotgun spread.
Image
B
14
S
4
Posts: 145
Reputation: 1,943

Post » Mon Dec 21, 2015 9:07 pm

How do you get the partials to have hit detection ?
B
8
Posts: 14
Reputation: 332


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, duditon, R0J0hound, yiuyiu6666 and 7 guests