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.

Discussion (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.