Top-down shotgun spread?

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

  • 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

  • I used particles for my shotgun spread.

  • How do you get the partials to have hit detection ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)