Skip to content

Commit d88f220

Browse files
committed
Release v2.2.0
1 parent aa559e0 commit d88f220

File tree

5 files changed

+50
-11
lines changed

5 files changed

+50
-11
lines changed

CHANGES.MD

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
## 2.2.0
3+
4+
* adding a kill method that forcibly kills the fireworks
5+
* updating live demo to use all available features
6+
* upgrade devDependencies
7+
8+
## 2.1.0
9+
10+
this should technically be breaking but I get the sense I don't have many consumers so I can get away with it :)
11+
12+
* renamed option "explosionHeight" to "explosionMinHeight"
13+
* new option, "explosionMaxHeight" - max height a rocket will reach before exploding.
14+
* various internal refactors
15+
* new `fire` method to fire a single rocket.
16+
* providing 0 for numRockets will not start rocket respawn timer (you must call `fire`)
17+
18+
## 2.0.1
19+
20+
* update build to use webpack.
21+
* update api - now exports class with `start` and `stop` methods.
22+
* lots of internal refactors.
23+
24+
## 1.0.3
25+
26+
* adding mechanism to stop fireworks
27+
28+
## 1.0.2
29+
30+
* initial release

README.MD

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const fireworks = new Fireworks(container, options)
3535
const stop = fireworks.start()
3636
stop() // stop rockets from spawning
3737
fireworks.stop() // also stops fireworks.
38+
fireworks.kill() // forcibly stop fireworks
39+
fireworks.fire() // fire a single rocket.
3840
```
3941

4042
## support

fireworks.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ class Fireworks {
125125
window.clearInterval(this.interval);
126126
this.interval = null;
127127
}
128+
kill() {
129+
this.things.clear();
130+
this.stop();
131+
window.cancelAnimationFrame(this.rafInterval);
132+
this.rafInterval = null;
133+
this.graphics.clear(true);
134+
}
128135
fire() {
129136
this.things.spawnRocket();
130137
if (!this.rafInterval) {
@@ -211,9 +218,9 @@ class Things extends Set {
211218
super();
212219
this.maxRockets = maxRockets;
213220
this.numParticles = numParticles;
214-
this.explosionMaxHeight = explosionMaxHeight,
215-
this.explosionMinHeight = explosionMinHeight,
216-
this.explosionChance = explosionChance;
221+
this.explosionMaxHeight = explosionMaxHeight;
222+
this.explosionMinHeight = explosionMinHeight;
223+
this.explosionChance = explosionChance;
217224
this.cw = cw;
218225
this.ch = ch;
219226
}

fireworks.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fireworks-canvas",
3-
"version": "2.1.2",
3+
"version": "2.2.0",
44
"description": "fireworks example",
55
"main": "./fireworks.min.js",
66
"scripts": {
@@ -30,12 +30,12 @@
3030
"license": "WTFPL",
3131
"dependencies": {},
3232
"devDependencies": {
33-
"awesome-typescript-loader": "^3.4.1",
34-
"rimraf": "^2.5.2",
33+
"awesome-typescript-loader": "^3.5.0",
34+
"rimraf": "^2.6.2",
3535
"semver-bumper": "^1.0.2",
36-
"tslint": "^3.13.0",
37-
"typescript": "^2.6.2",
38-
"uglifyjs-webpack-plugin": "^1.1.2",
39-
"webpack": "^3.9.1"
36+
"tslint": "^3.15.1",
37+
"typescript": "^2.8.1",
38+
"uglifyjs-webpack-plugin": "^1.2.4",
39+
"webpack": "^3.11.0"
4040
}
4141
}

0 commit comments

Comments
 (0)