npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whiskerweb

v0.5.2

Published

![WhiskerWeb Logo](http://slynch.xyz/images/whiskerweb_256.png)

Downloads

4

Readme

WhiskerWeb Logo

WhiskerWeb

A TypeScript ECS framework built on-top of PixiJS v8 for interactive WebGPU/WebGL rendering or game development. Long live catto.

Why use WhiskerWeb?

  • Flexibility: WhiskerWeb extends PixiJS with ECS functionality as well as lots of other useful QoL features for developing on web, but you can happily ignore the ECS entirely and use PIXI directly.
  • Speed: Utilising PIXI v8, WhiskerWeb was designed to make full use of cutting-edge WebGPU technology.
  • Ease of Use: Simply install the module, instantiate the engine, and start making your game state!

Dependencies

Getting started

Simply clone Slynchy/whiskerweb-template and initialize git submodules to get started.

Alternatively, you can install the module via npm:

npm install whiskerweb --save-dev

Or clone this repository and build it yourself:

git clone [this repo]
cd whiskerweb
npm ci
npm run build

npm link

Once you have the module installed, you can import the engine and start using it in your project:

import { Engine, State } from "whiskerweb";

class MyGameState extends State {
  onAwake(): void {}
  onResize(): void {}
  onStep(): void {}
  preload(): void {}
  onDestroy(): void {}
}

async function main() {
  const engine = new Engine();
  await engine.init(
    new MyGameState(),
  );
}

main();

Notes

  • Do not install PIXI via npm; instead, import the PIXI exports from whiskerweb directly.
  • HelperFunctions is a class of useful static functions for development, from older versions of the framework.
    • Helpers is the newer home for helper functions, and is a namespace for helper functions.

Project structure

  • Assets - ./src/assets/**/*
    • Contains required templates for the game (e.g. index.html, main.css, etc.)
  • Config - ./src/config/whiskerConfig.ts
    • Contains the interface for configuring the engine on initialization.
  • Components - ./src/engine/Components/**/*
    • Contains the base ECS components for the engine.
  • Systems - ./src/engine/Systems/**/*
    • Contains the base ECS systems for the engine.
  • Engine - ./src/engine/Engine.ts
    • Contains the main engine class.
    • Globally accessible with ENGINE.
  • Platform bindings - ./src/engine/PlatformSDKs.ts
    • Contains the interface for platform-specific SDKs.
  • Helpers/HelperFunctions - ./src/engine/HelperFunctions/**/*
    • Contains all the helper functions for the framework.
  • Savers - ./src/engine/Savers/**/*
    • Contains the base classes for saving and loading game states to storage
    • (Currently only LocalStorageSaver)
  • Types - ./src/engine/Types/**/*
    • Contains the base types for the engine.
  • Savers - ./src/engine/ModularPathFinding/**/*
    • Some helper functions for pathfinding.

Project terminology

  • Engine - The main funnel for all framework functionality. This is passed as a reference to most onSomething functions.
  • GameObject - Essentially a Container from PIXI, but can have components added to it. Prefabs should extend this.
  • Component - A relatively-small class that contains as little logic as possible.
    • Preferably only holds data, but for abstracting PIXI, it's often unavoidable to require some logic to sync the component abstraction with the library implementation.
  • Scene - A 2D container for multiple GameObjects (e.g. Level, WorldMap)
  • State - An abstraction beyond Scene to represent areas of a game (e.g. Init, Game, MainMenu)
    • Note: Adding a GameObject to an active scene of an active state will automatically call onStep every frame.
  • "Step" - A single frame, handled by the framework abstracting PIXI.Ticker