New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sprunk-engine

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sprunk-engine

## Description A TypeScript game engine designed to be simple and small (Only 50 kb once minified) but modular, and extensible. It is intended to be used primarily in the browser.

latest
Source
npmnpm
Version
0.4.12
Version published
Weekly downloads
3
-90.32%
Maintainers
2
Weekly downloads
 
Created
Source

Sprunk - A TypeScript Web Game Engine

Description

A TypeScript game engine designed to be simple and small (Only 50 kb once minified) but modular, and extensible. It is intended to be used primarily in the browser.

This engine architecture focus on event driven architecture and enforcing a strict separation of concerns between the different components of the engine. Not only for the engine itself but also for the games built on top of it.

Features

  • WebGPU 3D rendering engine (with support for Sprites, Meshes, Line drawing and Text)
  • 2D polygon physics engine
  • Audio engine
  • Input system supporting multiple gamepads, keyboard, and mouse
  • Dependency injection system
  • Debugging tools

Use sprunk in your project

Prerequisites

Install the package with npm

npm i sprunk-engine

Fork a empty project to get started (with guided sample code)

Go to the empty project and click on the "Fork" button.

How to use ? (Examples)

Depending on what you want to do, you can check these examples:

You can also check the end-to-end tests of this project, providing small examples of how to use the engine:

Documentation

The documentation is available in the doc folder. Here are some useful links:

Getting Started (for maintainers)

Prerequisites

Run the project

Install packages

npm install

Run vite dev server

npm run dev 

Run the tests

npm run test

Deployment

Build the project as a library

  npm run build

This will generate a dist folder containing the library files.

Build the project as a web application

  vite build

This will generate static files in the dist folder. You can then deploy these files to a any web server.

Generate documentation

Class diagrams

  npm run generate-uml

Website documentation

  npm run generate-doc

This will generate a /doc/site/build folder containing the documentation (static website).

Collaborate

Directory structure

├───doc                     # Documentation
├───src                     # Source code
│   ├───Core                # Core components
│   │   ├───Caching         # Cache management system
│   │   ├───DependencyInjection  # Dependency injection system
│   │   ├───EventSystem     # Event and callback helpers
│   │   ├───Initialisation  # Engine initialization
│   │   ├───MathStructures  # Math structures (Vector, Quaternion, Transform)
│   │   ├───Tickers         # Time management and game loop control
│   │   ├───Utilities       # Utility functions (Array, Math, etc.)
│   ├───Extensions          # Extensions and modules
│   │   ├───AudioEngine     # Audio behaviors
│   │   ├───Debugger        # Debugging tools
│   │   ├───InputSystem     # Web input system (Gamepads, Keyboard, Mouse)
│   │   ├───PhysicsEngine   # 2D polygon physics engine using SAT
│   │   ├───RenderEngine    # WebGPU rendering engine
├───test                    # Unit tests (Vitest)
│   ├───CommonResources     # Shared resources (assets) for tests
│   ├───Core                # Core component tests
│   ├───ExampleBehaviors    # Reusable example behaviors for tests
│   ├───Extensions          # Extension tests
│   │   ├───Some Extension  # One folder per extension
│   │   │   ├───Assets      # Assets used for the specific extension
│   │   │   ├───Mocks       # Mocks for the extension
│   │   │   ├───Integration # Integration tests for the extension (html files, etc.)

Class syntax

The classes are written in order to follow the Google TypeScript style guidelines

Workflow

  • Gitflow
  • How to commit
  • How to use your workflow
  • Propose a new feature in Jira
    • We only use tasks
  • Pull requests are open to merge in the develop branch.
  • Release on the main branch we use GitFlow and not with GitHub release.
  • When creating a new feature, the branch name must be feature/SPR-XX-NameOfTheFeature
  • Before merging a feature into develop, the code should be reviewed by one other person (by opening a pull request).
  • Issues are added to the github issues page

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

  • If needed you can create an issue on GitHub we will try to respond as quickly as possible.

Keywords

webgpu

FAQs

Package last updated on 30 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts