Add crashing

This commit is contained in:
asraelite 2018-03-07 14:51:18 +00:00
parent bd97945e66
commit 60f77c36a9
9 changed files with 67 additions and 10 deletions

View file

@ -27,6 +27,37 @@ export function createEndEditBurst(ship) {
}
}
export function createCrash(ship) {
for (let i = 0; i < ship.mass + 3; i++) {
particles.add(new Particle(...ship.poc, {
color: '#f2e860',
lifetime: Math.random() * 50 + 40,
size: Math.random() * 0.2 + 0.2,
spray: 0.9,
gravity: true
}));
}
for (let i = 0; i < ship.mass + 3; i++) {
particles.add(new Particle(...ship.poc, {
color: '#f75722',
lifetime: Math.random() * 50 + 40,
size: Math.random() * 0.2 + 0.2,
spray: 0.5,
gravity: true
}));
}
for (let i = 0; i < ship.mass * 2 + 3; i++) {
particles.add(new Particle(...ship.poc, {
color: '#888',
lifetime: Math.random() * 30 + 55,
size: Math.random() * 0.5 + 0.4,
spray: 2,
friction: 0.9,
gravity: false
}));
}
}
export function createPickupBurst(ship, point) {
for (let i = 0; i < 20; i++) {
particles.add(new Particle(...point, {