Basic browser implementation of first-person shooter controls in 3D space, with a physics-based projectile and animated firing motion.
After initially experimenting with Three.js’ orbital controls in class, I immediately was motivated to program first-person controls. This I was able to do, but the movement was jittery (moving some number of in-game units instantly rather than smoothly) and a little bit inconsistent. Fortunately Three.js has customizable flight controls as part of its native library, which are what you see in action here.
Physi.js, a physics library for Three.js, governs the bullet motion and collision detection. A few rudimentary textures were added to the gun barrel and to the bullets, along with some sounds taken from freesound.org.
Play Spaceflight on Heroku.
See the vid on instagram:
https://www.instagram.com/p/BesmBAED28z/?taken-by=spicedacademy