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

pixi-rainman-game-engine

v0.1.53

Published

This repository contains all of the mechanics that used in rainman games.

Downloads

874

Readme

RainMan pixi game engine

This repository contains all the mechanics that used in RainMan games. This library uses pixi and pixi-spine as dependencies.

Development scripts

In this repository you have directory scripts, contains scripts for deployment to digital ocean and preparing tags and releases for games. As you can use linux or MacOS environment, you should add permissions for executing the script. To do this you should perform a command:

chmod +x ./scripts

After adding permissions for scripts, to operate the scripts you should installed following programs:

In the scripts directory, you have three scripts:

  1. apply_diff.sh
    This script applying should apply diff file for all of the games. This should automate adding the same changes to the all games that uses engine.

    Example:

    ./scripts/apply_diff.sh "CD-XXX" "XXX" ./newChanges.diff
  2. auto_merge.sh
    This scripts is used for merging pull requests with given issue. This scripts uses gh, which is responsible for communicating with github. This scripts, have option to create git tag and release for deployment. To enable this option you should add true second parameter.

    Example:

    ./scripts/auto_merge.sh "CD-XXX"
  3. prepare_for_deployment.sh
    This scripts is used to preparing for deployment on DigitalOcean. The script automates changing the version and adding date to version in package.json for each game. Default behavior is to increase the patch version of the game. This script uses environment variable PR_REVIEWER, to add reviewer/s to each pr.

    Example:

    ./scripts/prepare_for_deployment.sh "CD-XXX" "Commit message"

Scripts

  1. To build library

    yarn build
  2. To build library during development

    yarn dev:build

    Modifying css files does not automatically reload server, after each change manual restart is needed.

    To have live updates in one of the games, link is recommended. It needs to be done just once, yarn will remember link to this package even after computer restart.

    yarn link

    After that use the following command in one of the games to use local version of the engine.

    yarn link pixi-rainman-game-engine

    Link is common to cause bugs when used together with npm version of the same package, that is why you should use helper commands engine:local and engine:npm in the games. If there are still some bugs (most common with pixi/layers) try deleting node_modules, installing dependencies without engine, linking engine and restart server. This should resolve all the problems.

    By using package from npm, in vite optimizeDeps you must exclude this package, but must include each package that throws error in the console. This is probably due to problem with excluding commonJS dependencies. An example is below.

    defineConfig({
        optimizeDeps: {
            include: [
                "ts-money",
                "adaptive-scale/lib",
                "stats.js",
                "url",
                "eventemitter3",
                "earcut",
                "react",
                "react-dom",
                "use-sync-external-store/shim",
                "classnames",
                "react-is",
                "react-custom-scroll",
                "react-dom/client",
            ],
            exclude: ["pixi-rainman-game-engine"],
        },
    });

    For each error in the console, e.g.:

    Uncaught SyntaxError: The requested module '/node_modules/eventemitter3/index.js?v=ec22a584' does not provide an export named 'default'

    you must include it in the optimizeDeps.include array. Typically, it is the name after /node_modules/.

  3. Lint project

    npm run lint

Game engine structure

Code for the game engine contains in the src directory. For creating a feature you should add new directory into src directory. For example: freeSpins and in this folder contains all the mechanics.

In utils directory there all the utility functions and types.

Creating a documentation in TypeDoc

Available tags to use you can check here: https://typedoc.org/guides/tags/