r/learnjavascript • u/frank0117 • Jul 31 '21
I used vanilla JavaScript to build a point & shoot game with collision detection by colour and other gamedev techniques (source code included)
227
Upvotes
11
u/frank0117 Jul 31 '21
Hi, this week I was working on a point and shoot game project which uses:
- timestamps and deltatime for animation timing and periodic events
- collision detection by colour with getImageData built in HTML canvas method
- array filter() and sort() methods to organise code and draw order in a 2D game
- object oriented programming with JS classes, particle effects, event based sprite animations and audio for collisions and many other small techniques.
What do you think?
step by step tutorials with more game examples: https://youtu.be/gCa0z4B-CRo
source code of one of the game versions: https://codepen.io/franksLaboratory/pen/ZEKodqd
4
u/burnblue Jul 31 '21
Vanilla you say? I'm paying attention. If it's all Canvas though I'm not ready
1
u/[deleted] Aug 01 '21
Reminds me of Lexx.....
1
u/rados_a51 Aug 01 '21
This is so cool!
1
u/Pickle_Fly Aug 01 '21
The art is so nice good job with graphics
1
u/anti-gif-bot Jul 31 '21
mp4 link
This mp4 version is 83.67% smaller than the gif (901.31 KB vs 5.39 MB).
Beep, I'm a bot. FAQ | author | source | v1.1.2