Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tinyjs-plugin-weapon

qingyangmoke11MIT0.1.1

tinyjs 武器发射系统

tinyjs, plugin, weapon

readme

tinyjs-plugin-weapon

武器发射系统插件

查看demo

http://tinyjs.net/#/plugins/tinyjs-plugin-weapon/demo

引用方法

1、最简单的例子

引用 Tiny.js 源码

<script src="https://gw.alipayobjects.com/as/g/tiny/tiny/1.1.5/tiny.js"></script>
// var Weapon = Tiny.Weapon;
// var Weapon = require('tinyjs-plugin-weapon');
weaponEmitter = new Tiny.Weapon.Emitter(app, Tiny.Loader.resources['bullet'].texture);
weaponEmitter.bulletSpeed = 300;
weaponEmitter.fireRate = 300;
weaponEmitter.autofire = true;
weaponEmitter.trackSprite(sprite, 0, -sprite.height / 2, true, -90);
container.addChild(weaponEmitter);

依赖

相关文档

特别声明

代码中部分算法 借鉴了 Phaser 的实现

API文档

http://tinyjs.net/#/plugins/tinyjs-plugin-weapon/docs

changelog

0.1.1

2017-12-18