DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

CodingWith-Adam
CodingWith-Adam

Posted on

Shooting Bullets in JavaScript - Game Dev

In this exciting video we are going to learn how to shoot bullets in a 2D game using JavaScript and a HTML canvas. We will code everything from scratch starting with a blank canvas. The bullet engine that we are going to build will be highly configurable. That means you can change the speed, damage amount and even limit the number of bullets that are fired at a time.

If you enjoy this tutorial please subscribe , like and share.

Top comments (1)

Collapse
 
taposhbarman profile image
Taposh-Barman

That's nice.Can you ensure me the logic about the movement of bullets?
I tried this way as below :
if(bullet.y<0) then bullet.y=heady_of_plane;
But the problem is if the heady_of_plane is very near at 0 position ,the velocity of bullets is increased.. That's exactly not what i am expecting.

Classic DEV Post from 2020:

js visualized

πŸš€βš™οΈ JavaScript Visualized: the JavaScript Engine

As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! πŸ₯³

Happy coding!