How do I make bullets shoot vertical?

0 favourites
  • 10 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • So I am making a vertical shooter game. How do i make my bullets shoot upwards instead of sideways? Right now when they shoot the fly to the right. Thanks in advance!

  • And one more question, I am trying to have it when you hold the left mouse button the bullets shoot automatically. Is there a way to change the rate of spawning?? I have set up a custom movement so that the player airplane moves towards where the mouse is clicked, but I need the bullets shooting at a lower rate

  • You can set the bullets angle when it's created to make it fly up instead

    As for rate of fire, make a variable for reload and set it to 0

    In the event where you fire a bullet make a subevent that says if reload=0

    so it will only fire if it's 0

    In the same event set reload to something above 0 once the bullet is fired

    Finally make an every tick event and set reload to subtract 1 if it's above 0

    Hope it makes sense:)

  • ok the reload makes sense, but how do I set the bullets angle when its created? Thanks :)

  • nevermind I found it :) thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • np:)

  • Ive got the bullets firing upwards, so now i just need to get the reload time down. I made the variable on the bullet and named it Reload. I made the subevent and made reload=0. Now what do I do for a moderate fire rate?

  • Try setting reload to 30 when you fire the bullet and go from there

  • You're going to want to use dt (delta time) for your reloading events.

    Here's a simple way to go about it;

    Every tick

       add dt to reload

    Reload = 1

       plane shoot bullet

       set reload to 0

    With this, you'll shoot every 1 second. You can change it to 1.5,

    and then you can shoot every second and a half.

    You can read more on deltatime here.

  • EDIT: Looks like you deleted your post. I'll leave the next part be.

    Also, you'll want to check if reload is equal or greater than what you want.

    I typed it out kinda fast, and missed that. If you didn't do that, then

    dt might add an odd number to reload, and you'd get 1.03 or something,

    and the condition would never trigger.

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