Learning three.js 09 :: Shooting & Projectiles
Adding a system for shooting projectile bullets. Source linked below.
In this video I create a very simple method for managing bullets in game, and solve problems such as bullet positioning, weird velocity vectors, and memory cleanup. An array is made to store bullets as THREE.Mesh, with an "alive" flag to track when bullets should be cleaned up.
This program uses code from video eight.
Because the bullets are THREE.Meshes, we can set them to be any mesh we want - see the bonus footage at the end to fully experience the gravity of this consequence.
source code - https://github.com/saucecode/threejs-demos/tree/master/09_Shooting
live demo - https://rawr.nz/webgl2/09_Shooting/index.html
github repo - https://github.com/saucecode/threejs-demos
Models sourced from http://kenney.nl.
threejs website - http://threejs.org
Direct your fruit/gift baskets to cahill.julian@gmail.com.
http://rawr.nz