@code-dot-org/p5.play

中文文档
1.3.21-cdo发布于 2023/02/16LGPL-2.1近 30 天下载 5855

Code.org fork of molleindustria/p5.play for use within the Code Studio learning environment.

原始使用文档
文档目录6 节
  1. Development
  2. Quick Start
  3. Unit Tests
  4. Documentation
  5. Examples
  6. Publishing a New Version

Build Status

This is the Code.org fork of p5.play. You can check out the main project here!

p5.play is a p5.js library for the creation of games and playthings.

You can find examples and more information at code-dot-org.github.io/p5.play.

p5.play provides a Sprite class to manage visual objects in 2D space and features such as animation support, basic collision detection and resolution, sprite grouping, helpers for mouse and keyboard interactions, and a virtual camera.

p5.play extends p5.js, a javascript library (and a community) that aims to make coding accessible for artists, designers, educators, and beginners. If you are not familiar with p5.js, you should start at p5js.org/tutorials.

Development

The following documentation is for developing p5.play itself. If you want to use p5.play, please see code-dot-org.github.io/p5.play.

Quick Start

First install node.js. Then run:

npm install
npm start

Your web browser should open to a welcome page. If it doesn't, visit localhost:8080 in your browser.

Unit Tests

To run the unit tests in your browser, visit localhost:8080/test.

To run them from the command-line, use npm test.

Documentation

The docs can be found at localhost:8080/docs or via the "Reference" link on the quick start welcome page.

Use npm run docs to regenerate the local documentation using YUIDoc.

A (mostly current) copy of the docs is also hosted at code-dot-org.github.io/p5.play/docs.

Examples

Several example sketches are available at code-dot-org.github.io/p5.play/examples.

You can try these examples against your local copy of p5.play at localhost:8080/examples or via the "Examples" link on the quick start welcome page.

Publishing a New Version

Run npm version <newversion> to publish a new version. This repository has preversion, version, and postversion scripts (see package.json), so this method is preferred over npm publish.

版本与发布记录

@code-dot-org/p5.play 共发布 37 个版本,首次发布于 2016/10/25;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.3.21-cdolatest2023/02/163 年前
1.3.20-cdo2021/08/275 年前
1.3.19-cdo2021/08/125 年前
1.3.18-cdo2021/06/305 年前
1.3.17-cdo2021/04/235 年前
1.3.16-cdo2021/04/205 年前

关于 @code-dot-org/p5.play 的常见问题

@code-dot-org/p5.play 是什么?

Code.org fork of molleindustria/p5.play for use within the Code Studio learning environment.

如何安装 @code-dot-org/p5.play?

在项目目录运行 npm install @code-dot-org/p5.play,或使用 pnpm add / yarn add / bun add。

@code-dot-org/p5.play 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/code-dot-org__p5.play 是否存在。

@code-dot-org/p5.play 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=4.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@code-dot-org/p5.play 可以商用吗?

@code-dot-org/p5.play 使用 LGPL-2.1 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@code-dot-org/p5.play 的下载量有多少?

根据 npm 官方下载统计,@code-dot-org/p5.play 在 2026/10/10 – 2026/11/08 这 30 天内被下载 5,855 次,日均约 195 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@code-dot-org/p5.play 还在维护吗?

最新版本 1.3.21-cdo 发布于 2023/02/16(3 年前);至今共发布 37 个版本,其中过去 12 个月发布了 0 个;首次发布于 2016/10/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。