tinyjs-plugin-weapon
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
demo
src
test
.editorconfig
.eslintignore
.eslintrc
.gitignore
CHANGELOG.md
README.md
package.json
webpack.config.js

README.md

tinyjs-plugin-weapon

武器发射系统插件

查看demo

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

引用方法

起步

首先当然是要引入,推荐NPM方式,当然你也可以下载独立版本,先从几个例子入手吧!

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