Learn The Basics of JavaScript and KAPLAY to Make Games Quickly
On my Substack, I usually publish tutorials teaching how to implement game mechanics in JavaScript using a library called KAPLAY.
KAPLAY is a simple and intuitive library for making games in JavaScript. It’s relatively new, which is why learning resources are scarce. However, it really does make game development easier and faster with its intuitive Entity Component System and built-in features.
However, if you happened to stumble on my Substack and are unfamiliar with JavaScript or KAPLAY, you might have found the content I produce inaccessible. That’s why I’d like to share these two video courses I originally uploaded on YouTube.
The first course will teach you the basics of JavaScript while assuming no prior programming experience. The second one will teach you how to make a game while introducing KAPLAY concepts and features gradually.
They are intended to be watched in the order presented below. If you already know JavaScript, feel free to skip the first course and jump immediately into the next one.
JavaScript Crash Course for Game Development
Note that it’s absolutely normal to not have mastered JavaScript after a 2 hour course (Even more so if you have 0 programming experience). However, additional resources are provided down below to further your learning.
Additional Resources Mentioned in This Course
Below are the timestamps for the course.
0:00 Intro
0:32 Why learn JS to make games?
5:44 Environment Setup
14:44 Core concept #1 : variable and constants
28:15 Core concept #2 : conditional statements and boolean operations
39:45 Core concept #3 : complex data types (Arrays and objects)
51:59 Core concept #4 : loops
1:06:06 Core concept #5 : functions + param passing by reference vs by value
1:18:34 Core concept #6 : local vs global scoping
1:21:20 Core concept #7 : comments + how import/export js code works
1:28:42 What is a library?
1:29:41 Setting a modern dev environment with Node.js, NPM and Vite
1:44:13 Making our first JS game
2:22:53 How to export your JS game to a platform like itch.io
2:24:56 Next steps (useful resources)
Practical Project : Sonic Themed Infinite Runner
In this course, you’ll learn how to build a Sonic themed infinite runner game. The player runs indefinitely but gets progressively faster. They must survive by either avoiding or jumping on enemies while collecting as many rings as they can. You can try out the game in your browser here.
You’ll be progressively introduced to KAPLAY concepts as we build the game.
Development Setup
In this course, I set up my development environment using NPM, Vite and Node. While these technologies arent’t hard for experienced web developers, they might be too complex for beginners. There is a simpler setup you can use that I present in the post below.
Relevant Links Mentioned in This Course
Below are the timestamps for the course.
0:00 Intro
3:47 Project Setup
21:22 Loading Assets
30:50 Making The Main Menu Scene
54:32 Creating The Sonic Game Object
1:03:19 Making The Game Scene
1:13:43 Implementing Sonic Gameplay
1:22:35 Implementing Enemy Logic
1:37:02 Implementing Ring + Score Logic
1:56:20 Making The Game Over Scene
2:05:47 How to Build The Game for Distribution
Next Steps
Now that you have the basics, you can start making your own games. Additionally, you can check my other substack posts explaining how to implement specific mechanics/how certain KAPLAY concepts work.