Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hazyvt/slifer

2D game framework made in bun
https://github.com/hazyvt/slifer

bun bunsh sdl2 sdl2-image sdl2-ttf slifer typescript

Last synced: 1 day ago
JSON representation

2D game framework made in bun

Awesome Lists containing this project

README

        

# Slifer : Native Typescript Game Framework



> [!CAUTION]
> Slifer is currently in alpha. Use at your own risk.

> [!NOTE]
> Not all basic features have been implemented. Many are missing such as
> window customization. As such, I recommend waiting for a beta release of
> Slifer before using it for a long term project.

Slifer is a game framework made to allow users to code games in typescript. The
framework uses bun and SDL2 under the hood to allow your game to render and
build natively to desktop.

If you'd like to learn more about Slifer, feel free to head to [Slifers Webpage](https://slifer.hazyvt.com).

## Contents

- [Goals](#goals)
- [Current Features](#current-features)
- [Future Features](#future-features)
- [Example](#example)

## Goals

- Contain all basic game framework implementations. Such as drawing images,
drawing text and making animations from a sprite sheet.
- Provide an easy transition from web development to game development.
- Create an easy to use framework. Slifer should handle the bulk of the work
- Keep updates consistent.

## Current Features

- Create a native desktop window with custom title and size.
- Handle both keyboard and mouse inputs
- Load and draw images onto the window

## Future Features

- Audio Implementation
- Animation library
- Save file library

## Example

```ts
import Slifer from "slifer";

Slifer.createWindow("Example Window", 640, 480);

const bg = Slifer.Graphics.makeColor(36, 36, 36, 255);

while (!Slifer.shouldClose()) {
Slifer.Graphics.setBackground(bg);

if (Slifer.Keyboard.isPressed("escape")) {
Slifer.isRunning = false;
}

Slifer.Graphics.render();
}

Slifer.quit();
```