Game library for 2d games written in Typescript.
GL HF stands for "Good luck, have fun!"
- assets - Helper to load assets files (JSON, Images).
- bitmask - Bitmask library for fast bitwise operations.
- component - Generic opinionated ECS Components.
- ecs - ECS Library that implements the following classes Entity, Component, System, Query, World
- fsm - Finite State Machine implementation.
- input - Implementation of inputs like Keyboard, Mouse and Controller.
- renderer - Rendering UI and Canvas utilities.
- matrix - Matrix system for binary grid.
- tiled - Matrix system for binary grid.
- demo - A demo of a 2d game implementation using glhf.js library
Library is currently under development.
You can see the progress by following me at https://www.youtube.com/@SerbanTV
Catch me on the Discord server to discuss stuff about game dev, ECS, etc.
npm install --save-dev eslint @eslint/js @types/eslint__js typescript typescript-eslint
import {map, state, keyboard, viewport, camera, start} from "@glhf/engine";
// Starting an endless game.
// Goals, move the player on the screen.
map("map.tmx")
entityDef("kil.json")
entitySprite("kil.png")
keyboard()
viewport({ width: 600, height: 400 })
camera({ width: 600, height: 400 })
start()
// Starting a game with a winning and losing condition.
state({ playerName: "Gali", playerScore: 0, gameStatus: PLAYING })
map("map.tmx")
entityDef("kil.json")
entitySprite("kil.png")
entityDef("dino.json")
entitySprite("dino.png")
keyboard()
viewport({ width: 600, height: 400 })
camera({ width: 600, height: 400 })
system('gameplay system', (world) => {
// This can have interactions between entities
// Winning conditions
// Losing conditions
// Scoring conditions?
})
start()