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

mutate-game

v1.2.12

Published

A music game combine rotate and music

Downloads

15

Readme

Mutate简介

Mutate是融合了musicrotate形成的单词,意为融合了音乐和旋转

这里展现了一些最基础的用法,详细用法请查看详细使用文档

English Documentation

安装

使用npm:

npm i mutate-game

使用pnpm:

pnpm add mutate-game

script标签引入,使用本地文件

<script src="your mutate.js path"></script>

使用cdn

<script src="https://cdn.jsdelivr.net/npm/mutate-game/dist/mutate-game.iife.js"></script>

插入到你的项目中

首先,你需要一个canvas,这是mutate运行的基础,当然也只需要一个canvas,mutate就能运行。

然后,你可以使用以下代码来向你的项目中插入mutate游戏

import * as mutate from 'mutate-game';

// 这里要求画布的长宽比为16:9,如果不是的话会自动调整
const canvas = document.getElementById('mutate');

const game = mutate.create(canvas);
// 加载游戏内容
await game.load('your music url', 'your mtt url');
game.start(); // 开始游戏

开发

如果你想开发本项目,在github上拉取后,可以按照以下步骤操作

安装依赖包

使用pnpm进行安装

pnpm i

进入开发环境

执行

pnpm dev

便可进入开发环境,在这里,你可以使用vue3+ts+less进行测试开发

打包

执行

pnpm build

便可进行打包,打包后的入口为dist/mutate-game.js,该项可以在vite.config.ts中配置