Hacker News new | ask | show | jobs
by chimi 2404 days ago
nah, it's on line 33 of player.js

   if(this.isShooting){
     this.bullet.y -= 0.1 * dt;
Changing that 0.1 to 1 would make the bullet move 10x faster. It'd be neat if you could have multiple bullets on the screen at the same time, but then the developer would need to maintain an array of bullets and update all of their .y values.

In this case, a new bullet is created when the .y value gets to zero, so there isn't an easy way to increase the firing rate except to increase the speed of the bullet.

By "easy" I mean, can be done in under 5 keystrokes to the code and without introducing potential bugs. Adding an array of bullets moving at the same rate, but able to be fired with less time delay between each bullet, would require at least an order of magnitude or two more than that amount of effort and also a not insignificant amount of testing.