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 🙏

© 2026 – Pkg Stats / Ryan Hefner

miaoda-game-wave-cocos

v0.3.2

Published

Cocos Creator skin for miaoda-game-wave-core: a thin @ccclass Component that owns a spawn director (discrete WaveRunner or continuous Director), drives it from the node's update(dt), and resolves each spawn's spawnPointId to a registered scene Node before

Readme

miaoda-game-wave-cocos

Use this Cocos Creator component to drive either a discrete WaveRunner or continuous Director, resolve spawn-point IDs to scene nodes, and hand spawn requests to your prefab code.

Install

pnpm add miaoda-game-wave-cocos miaoda-game-wave-core

cc is an optional peer dependency supplied by your Cocos project.

Minimal wave spawner

import { instantiate } from 'cc';
import { WaveDirectorComponent } from 'miaoda-game-wave-cocos';

const spawner = level.addComponent(WaveDirectorComponent)
  .registerSpawnPoint('left', leftMarker)
  .onSpawn((type, point) => {
    const enemy = instantiate(enemyPrefabs[type]);
    if (point) enemy.setWorldPosition(point.worldPosition);
    enemy.parent = enemyLayer;
    enemy.on('died', () => spawner.reportKilled());
  })
  .setupWaves({
    waves: [{ groups: [{ type: 'goblin', count: 5, interval: 0.5, spawnPointId: 'left' }] }],
  })
  .start();

Register every referenced spawn point before start(). An unknown or omitted ID produces undefined, so the spawn handler must choose a fallback position if that is allowed.

Cocos update(dt) supplies seconds automatically. Use setTicking(false) to pause spawning without disabling the node. Call reportKilled yourself; the component cannot infer when a spawned entity dies.

For a game-owned fixed tick, select manual ownership while installing the current model:

spawner.setupWaves(config, { tickSource: 'manual' });

fixedStepper.advance(frameDeltaSeconds, ({ dt, index }) => {
  const from = pendingSpawns.length;
  spawner.stepSimulation(dt);
  commitSpawnBatch(index, pendingSpawns.slice(from));
});

The default source is host. Manual mode makes Component update(dt) inert and exposes only the seconds-based stepSimulation. Calling it in host mode fails before Core state or callbacks change. setTicking is a separate local pause. Synchronous spawn callbacks are grouped by the game around each manual call; the adapter does not introduce a second event bus or discard catch-up ticks.

Use setupWaves or setupDirector on a component, not both at once; the latest valid setup replaces the previous model and selects its tick source. Invalid config/source leaves the active model and source intact. Access waveRunner or spawnDirector snapshots for deterministic observation. onDestroy is terminal; create a new component with a restarted Scene instead of reusing it.

Public API

WaveDirectorComponent exposes setup, source selection, manual stepping, spawn-point registration, onSpawn, start, reportKilled, ticking control, and core getters. WaveComponentOptions and WaveTickSource are exported with the existing core classes/types. The adapter does not instantiate or pool enemies for you.