Making Awesome Games with LittleJS

Rate this content
Bookmark

LittleJS is a super lightweight game engine that is easy to use and powerfully fast. The developer will talk about why he made it, what it does, and how you can use it to create your own games. The talk will include a demonstration of how to build a small game from scratch with LittleJS.

Frank Force
Frank Force
34 min
07 Apr, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Little.js is a super lightweight and fast JavaScript game engine that has everything included to start making games right away. It has a tiny footprint and no dependencies, making it perfect for size-coding competitions like JS13K. Little.js is built with an object-oriented structure and comes with several classes. It provides a fast rendering system, a comprehensive audio system, and various starter projects for different game types. Little.js is designed to be simple and easy to understand, allowing you to look at and modify the code.

1. Introduction

Short description:

Welcome to my talk about LittleJS Engine and how you can make awesome games with it. I'm Frank Forse, the creator of LittleJS. I've worked in game dev for over 20 years on some games you've probably played, like DOOM, PsyOps, and Starhawk. I've also completed many 48-hour game jams and won second place. I've published over a thousand tiny JS programs on Twitter, creating a wide variety of visual outputs. Recently, I've been interested in long form generative art.

Hi, everyone. Welcome to my talk about LittleJS Engine and how you can make awesome games with it. Who am I? Well, I'm Frank Forse, the creator of LittleJS. I've worked in game dev for over 20 years on some games you've probably played, like DOOM, PsyOps, and Starhawk. I've also completed many 48-hour game jams, and I've done a lot of other indie dev stuff. I've done a few JS 13k's and won second place. I've also won Optical Illusion of the Year with a JS program, and I've published over a thousand tiny JS programs on a website called Twitter, where we make 140-character JS programs. They are super small, but I've managed to create a wide variety of visual outputs. More recently, I've been interested in long form generative art, like you see here, which are all created with JavaScript.

2. Little.js Game Engine

Short description:

Little.js is a super lightweight and fast JavaScript game engine that has everything included to start making games right away. It has a tiny footprint and no dependencies, making it perfect for size-coding competitions like JS13K. Little.js is packed full of features, including fast sprite rendering, a level data-rendering system, mobile and touch support, physics and collision handling, and a unique audio system. It also provides an all-inclusive input handling solution and has comprehensive documentation. Join our Discord community to share your work and ask questions.

So what is Little.js, and why should you care? Well, Little.js is a super lightweight and fast JavaScript game engine. It has everything included to start making games right away, and several example projects to get you started. It is also very important to make sure that this is released with an open source MIT license, so that anyone can use it without worrying about complicated licensing agreements.

Little.js is best demonstrated by my game Space Huggers, which I originally released for JS13K, but I've later updated it on new grounds. So please check that out for a great demonstration of all the stuff that Little.js can do. Little.js is packed full of features, with everything included to start making games. For many game engines, the size of the game engine is not a feature, but for Little.js, it is one of the main features because the footprint is extremely tiny. There are no dependencies and I made sure that the interface is also super streamlined. This allows it to fit in a super small zip file for size-coding competitions like JS13K, but also makes the code very easy to use and work with. It's a great way to start learning about how game engines work. It can also make big games, too. We'll talk about that soon.

Because it has very, very fast sprite rendering of on the order of 100,000 sprites. And it also has a super fast level data-rendering system, too. Combining these two things, you can have a fully featured game with WebGL and canvas support for the best of both worlds. It also has mobile and touch support, because that's so important these days. Little.js is an object-oriented game engine that uses EngineObject as the base class. You can extend this for use in your own game. Every EngineObject will automatically be updated and drawn every frame. It also has physics and collision handling built in, and some other features that you will need, like a parent-child system and sorting for rendering and debug features. Little.js has a very unique audio system with positional generative audio. You can create sound effects without needing any kind of asset file, so it's a very fast to iterate with. And these sound effects are positional so that the stereo panning and volume is automatically attenuated to make it sound like it's coming from a location in the world. Little.js also provides a tiny music system, which is really useful for size coding competitions. And you can of course use WAV MP3 or ODD files too. Little.js has an all-inclusive input handling solution for keyboard and mouse as well as up to four gamepads, and even has an on-screen gamepad for touch devices. The code is fully documented. There's a website that you can browse all the documentation, which is auto-generated from code in the comments using js-doc. The code itself is also very simple and easy to read, and it's packed full of comments so that everyone can understand how everything works. There's a build system included with several starter projects, and we've recently created a Discord for people to share their work and ask questions.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
The open source PlayCanvas game engine is built specifically for the browser, incorporating 10 years of learnings about optimization. In this talk, you will discover the secret sauce that enables PlayCanvas to generate games with lightning fast load times and rock solid frame rates.
Building Fun Experiments with WebXR & Babylon.js
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Building Fun Experiments with WebXR & Babylon.js
Top Content
During this session, we’ll see a couple of demos of what you can do using WebXR, with Babylon.js. From VR audio experiments, to casual gaming in VR on an arcade machine up to more serious usage to create new ways of collaboration using either AR or VR, you should have a pretty good understanding of what you can do today.
Check the article as well to see the full content including code samples: article. 
How Not to Build a Video Game
React Summit 2023React Summit 2023
32 min
How Not to Build a Video Game
In this talk we'll delve into the art of creating something meaningful and fulfilling. Through the lens of my own journey of rediscovering my passion for coding and building a video game from the ground up with JavaScript and React, we will explore the trade-offs between easy solutions and fast performance. You will gain valuable insights into rapid prototyping, test infrastructure, and a range of CSS tricks that can be applied to both game development and your day-to-day work.
Boost the Performance of Your WebGL Unity Games!
JS GameDev Summit 2023JS GameDev Summit 2023
7 min
Boost the Performance of Your WebGL Unity Games!
Unity, when deployed on the web, faces three critical challenges: build size, memory usage, and overall performance. This lecture delves deep into advanced optimization techniques to help you address each of these issues. Attendees will gain insights into:
- Effective strategies for optimizing textures, audio, and models.- A detailed analysis of our ASTC experimentation with Unity, shedding light on the unexpected results despite Unity's claims.- A comprehensive guide to Unity's memory profiling tool and its implications.- An exploration of lesser-known Unity settings that remain underutilized by many developers.
Additionally, we'll introduce our proprietary tool designed specifically for Unity optimization. We will also showcase CrazyGames' developer dashboard, our platform that enables developers to monitor and enhance the performance of their web-based games seamlessly. 
Join us to equip yourself with the latest strategies and tools to elevate your Unity web gaming projects.
How to Make a Web Game All by Yourself
JS GameDev Summit 2023JS GameDev Summit 2023
27 min
How to Make a Web Game All by Yourself
It's never been easier to make your own web game, but it's still extremely difficult. What game should you make? Which engine should you choose? Let's discuss how to answer these problems and ways to leverage the unique platform that is the web.

Workshops on related topic

Make a Game With PlayCanvas in 2 Hours
JSNation 2023JSNation 2023
116 min
Make a Game With PlayCanvas in 2 Hours
Top Content
Featured WorkshopFree
Steven Yau
Steven Yau
In this workshop, we’ll build a game using the PlayCanvas WebGL engine from start to finish. From development to publishing, we’ll cover the most crucial features such as scripting, UI creation and much more.
Table of the content:- Introduction- Intro to PlayCanvas- What we will be building- Adding a character model and animation- Making the character move with scripts- 'Fake' running- Adding obstacles- Detecting collisions- Adding a score counter- Game over and restarting- Wrap up!- Questions
Workshop levelFamiliarity with game engines and game development aspects is recommended, but not required.
PlayCanvas End-to-End : the quick version
JS GameDev Summit 2022JS GameDev Summit 2022
121 min
PlayCanvas End-to-End : the quick version
Top Content
WorkshopFree
João Ruschel
João Ruschel
In this workshop, we’ll build a complete game using the PlayCanvas engine while learning the best practices for project management. From development to publishing, we’ll cover the most crucial features such as asset management, scripting, audio, debugging, and much more.
Introduction to WebXR with Babylon.js
JS GameDev Summit 2022JS GameDev Summit 2022
86 min
Introduction to WebXR with Babylon.js
Workshop
Gustavo Cordido
Gustavo Cordido
In this workshop, we'll introduce you to the core concepts of building Mixed Reality experiences with WebXR and Balon.js.
You'll learn the following:- How to add 3D mesh objects and buttons to a scene- How to use procedural textures- How to add actions to objects- How to take advantage of the default Cross Reality (XR) experience- How to add physics to a scene
For the first project in this workshop, you'll create an interactive Mixed Reality experience that'll display basketball player stats to fans and coaches. For the second project in this workshop, you'll create a voice activated WebXR app using Balon.js and Azure Speech-to-Text. You'll then deploy the web app using Static Website Hosting provided Azure Blob Storage.