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
4
u/burnblue Jul 31 '21
Vanilla you say? I'm paying attention. If it's all Canvas though I'm not ready
1
1
1
1
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