Java Programming: Let's Build a Zombie Game #4

Опубликовано: 17 Май 2026
на канале: RealTutsGML
11,782
139

Find Source Code and Courses https://www.codingmadesimple.com

in this tutorial we develop a shooting system into the game! Here is the code for the angles...

float angle = (float) Math.atan2(my - tempPlayer.y, mx - tempPlayer.x);
int bulletVelocity = 10;
tempBullet.velX = (float) ((bulletVelocity) * Math.cos(angle));
tempBullet.velY = (float) ((bulletVelocity) * Math.sin(angle));

Twitter ►   / realtutsgml  

Have fun learning!

   • Java Programming: Let's Build a Zombie Gam...