I'm playing around with the top down shooter from one of the tutorials here and I'm trying to make a "bullet spread" item. Preferably I wanted to make it at random angles within a certain angle space oriented by the player's own angle. It'd be something like a "triangle" in which bullets are shot at random angles within it. My question is: is it possible to do so? And if so, how?
Yes it is possible. You have to set the bullets angle on creation to random(player.angle-45, player.angle+45). This whould spread the bullets in a 90° range infront of the player.
Develop games in your browser. Powerful, performant & highly capable.
I'm going to try that out, really thanks for the reply!
That worked like a charm, thanks a lot!
Glad I could help. You can change the 45 values to anything you want to increase the spread. If you change them to 90° the player should spreed the bullets at a 180° angle.
I'm having some fun with it by doing a flamethrower, I've set them to 15º both and made the fade in and out times quicker and the speed higher. It's so fun to kill everything with fire haha