How to shoot in two directions?

Get help using Construct 2

Post » Wed Jul 15, 2015 10:08 am

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?
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Jul 15, 2015 10:14 am

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 told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 15, 2015 10:15 am

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.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Wed Jul 15, 2015 11:23 am

paulscottrobson wrote: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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Jul 15, 2015 11:23 am

LittleStain wrote: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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Jul 15, 2015 11:28 am

Calfuso wrote:
LittleStain wrote: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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 15, 2015 12:35 pm

LittleStain wrote:
Calfuso wrote:
LittleStain wrote: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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Jul 15, 2015 12:40 pm

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. :)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 15, 2015 1:49 pm

LittleStain wrote: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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Jul 15, 2015 1:54 pm

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 ;)
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,613

Next

Return to How do I....?

Who is online

Users browsing this forum: babymumu and 4 guests