How to shoot in two directions?

0 favourites
  • 15 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • I know how to make the player shoot to begin whit. You make it spawn a object on a image point on button pressed. The problem is that it only shoots to the rigth. You can't shoot the left. How do you make the player be able to shoot to the rigth and left?

  • Setting the bullet direction after spawn?

    If it's only shooting right, your bullet's angle of motion is probably 0..

    To shoot to the left you should set the angle of motion to 180..

  • Presuming you are using bullet behaviour ; there is an action which is something like "Set Bullet Angle of Motion" (can't remember exactly, but it's something like that) which will make the bullet go any direction you like. So spawn two bullets rather than one, and send one the other way.

  • Presuming you are using bullet behaviour ; there is an action which is something like "Set Bullet Angle of Motion" (can't remember exactly, but it's something like that) which will make the bullet go any direction you like. So spawn two bullets rather than one, and send one the other way.

    I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Setting the bullet direction after spawn?

    If it's only shooting right, your bullet's angle of motion is probably 0..

    To shoot to the left you should set the angle of motion to 180..

    I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.

  • > Setting the bullet direction after spawn?

    >

    > If it's only shooting right, your bullet's angle of motion is probably 0..

    > To shoot to the left you should set the angle of motion to 180..

    >

    I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.

    Yeah, so if you are facing right you should set the bullet angle of motion to 180 and if you are facing left set the angle to 0..

  • >

    > > Setting the bullet direction after spawn?

    > >

    > > If it's only shooting right, your bullet's angle of motion is probably 0..

    > > To shoot to the left you should set the angle of motion to 180..

    > >

    >

    > I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.

    >

    Yeah, so if you are facing right you should set the bullet angle of motion to 180 and if you are facing left set the angle to 0..

    It works but if i shoot a bullet when i am facing rigth and then face left the bullet change direction to left after i have shot it. The bullet i just shot should keep the direction it had when i shot it. It changing the direction when i do will be troublesome if i shoot much and need to move much at the same time.

  • It seems like you are setting the bullet direction every tick, while you only want to set it once..

    You could either use a bullet on created event or set the direction in the spawn event itself..

    Just asking, because these are pretty basic events/actions, did you follow any of the beginners tutorials and read the manual to get you acquainted with how Construct2 works?

    This site provides great documentation.

  • It seems like you are setting the bullet direction every tick, while you only want to set it once..

    You could either use a bullet on created event or set the direction in the spawn event itself..

    Just asking, because these are pretty basic events/actions, did you follow any of the beginners tutorials and read the manual to get you acquainted with how Construct2 works?

    This site provides great documentation.

    While this may seem easy for you it isn't as easy for me. I know that tutorials help you and i have read some. It's just that it's hard to find the answer how to do specific things by just readinbg tutorials. Asking in these forums is easier whit that. the stretching arm out thing fro example i consider a complex thing and i doubt i easily would find a tutorial that covered that. And if you fifn it annoying to answer all my questions then don't. You seem to be the only one answering today so i could migth aswell get help from sombody else. Call me a uber noob but i still can't make the shoot in two directions work. If you still want to bother you could please post a url of a succesfull event sheet of shoot in two directions.

  • Post a screenshot of the piece of code where you are setting the angle of motion for the bullet.

    LittleStain gave you the key to your question, now it's just a detail to achieve exactly what you want

  • > And if you fifn it annoying to answer all my questions then don't. You seem to be the only one answering today so i could migth aswell get help from sombody else.

    >

    I'm not sure where you read that I find it annoying, for I'm sure I havent said that anywhere..

    My question if you read the manual and followed the tutorials is just that, a question..

    I'm sure it will be much easier to create the program you want and understand the answers we give to your questions on this forum when you get the basics of making games with Construct2.

    Just trying to be helpfull.

  • Im having the same problem. There is the picture of my code: ibb.co/jqw7FS

    I have it so when I press left key it moves to the left, and when I press right key it moves to the right. When I press space it shoots. But it only shoots to the left. how do I make it shoot to the right when my character is facing the right, and left if its facing left?

  • EskilPotet,

    Do you mirror your character when it's moving to the left?

    If yes, then you should add another sub-event after you spawn your bullet:

    Character is mirrored -> Set bullet angle of motion to 180

    So when not mirrored, the angle will be 0, when mirrored the angle will be 180.

  • it worked! thanks!

  • try this

    If player face Right set bullet angle to 0

    else

    bullet angle to 180

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