crisp-game-lib, a game library for creating mini-games with minimal effort
Tags: gamedev, javascript, typescript
Published: 2022-05-17 10:26:51

`crisp-game-lib` is a JavaScript library for making browser games quickly and easily. I made 50 minigames in 2014, and I made Haxe library [mgl](https://github.com/abagames/mgl) and CoffeeScript library [mgl.coffee](https://github.com/abagames/mgl.coffee) to make those games. After that, I continued to make mini-games and libraries. Using this experience, I created `crisp-game-lib` as a library with the minimum functionality needed to create classic, arcade-like mini-games.

{% embed https://github.com/abagames/crisp-game-lib %}

I have already made more than 150 games using `crisp-game-lib`, and this library has been well [dogfooded](https://en.wikipedia.org/wiki/Eating_your_own_dog_food). With `crisp-game-lib`, you can create browser games that work on PC and mobile by simply writing the game's `title`, `description`, and the `update` function that is called 60 times per second as a single JavaScript file (click the image below to play).

The game has all the functions necessary for mini-games: drawing functions for boxes, lines, arcs, text, characters, etc., 

[![ref_drawing screenshot](https://github.com/abagames/crisp-game-lib-games/raw/main/docs/ref_drawing/screenshot.gif)](https://abagames.github.io/crisp-game-lib-games/?ref_drawing)

[Drawing functions](https://abagames.github.io/crisp-game-lib-games/?ref_drawing)

a collision detection function integrated with these drawing functions, 

[![ref_collision screenshot](https://github.com/abagames/crisp-game-lib-games/raw/main/docs/ref_collision/screenshot.gif)](https://abagames.github.io/crisp-game-lib-games/?ref_collision)

[Collision detection function](https://abagames.github.io/crisp-game-lib-games/?ref_collision)

[an input acquisition function](https://abagames.github.io/crisp-game-lib-games/?ref_input) that supports both mouse and touch panels, and [a sound effect function](https://abagames.github.io/crisp-game-lib-games/?ref_sound) allows you to select the name of the sound you want to play.

In addition, there is a BGM function that is automatically generated simply by setting `isPlayingBgm` to `true` in the options. If you don't like the sound generated, you can change the sound by giving an appropriate integer to `seed`.

There is also a replay function that can be enabled simply by setting `isReplayEnabled` to `true`. By merely selecting `theme`, we can change the game's appearance to retro CRT style, dot art style, etc. We can define the pixel art with the `characters` array.

There is also [an article on the crisp-game-lib](https://terrysfreegameoftheweek.com/kento-chos-crisp-game-lib-games/) written by [Terry Cavanagh](https://twitter.com/terrycavanagh), known as the developer of [Super Hexagon](https://store.steampowered.com/app/221640/Super_Hexagon/) and [VVVVVV](https://store.steampowered.com/app/70300/VVVVVV/).

`crisp-game-lib` is not suitable for creating complex, long-playing games. But we can make simple action games with this library in a short time. I would be happy if you could use it to create mini-games for your daily hobbies or prototyping hyper-casual games.