• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

need help with projectiles

M

Mister10

Guest
working on a platformer, and one of the playable characters shoot left and right.
I have an issue here whenever he shoots, he shoots a ton of arrows when he is supposed to shoot 1.
I've tried making it when you release the button, but it doesn't work. please help me.
 
T

TonyCold

Guest
Step Event
Code:
var shoot = keyboard_check_pressed(vk_space(or whatever.))
if (shoot){
    /// Shoot Arrows.
}
 
T

TonyCold

Guest
working on a platformer, and one of the playable characters shoot left and right.
I have an issue here whenever he shoots, he shoots a ton of arrows when he is supposed to shoot 1.
I've tried making it when you release the button, but it doesn't work. please help me.
And if you want the code of the bullets you might use
Code:
bullet = instance_create(x,y,pbj_bullet)
bullet.direction = direction
bullet.speed = 30 // Or whatever you want.
 
T

Tonydaderp

Guest
And if you want the code of the bullets you might use
Code:
bullet = instance_create(x,y,pbj_bullet)
bullet.direction = direction
bullet.speed = 30 // Or whatever you want.
He is right. When creating projectiles, you have to create them with a variable so that when you create another bullet going the opposite direction, it doesnt manipulate the direction of the pre-existing bullet instance. :)
 
Top