Dirt explosion color
This commit is contained in:
1 parent
2928336abf
commit
04a17063cb
1 file changed
+6
-2
+6
-2
@@ -8,6 +8,10 @@ export function drawExplosion(ctx, x, y, r) {
|
|||||||
drawCircle(ctx, x, y, r, `rgb(${color}, 0, 0)`);
|
drawCircle(ctx, x, y, r, `rgb(${color}, 0, 0)`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function drawDirt(ctx, x, y, r) {
|
||||||
|
drawCircle(ctx, x, y, r, 'burlywood');
|
||||||
|
}
|
||||||
|
|
||||||
export const WEAPON_TYPES = [
|
export const WEAPON_TYPES = [
|
||||||
{id:'baby-missile', name:'Baby Missile', explosion:{type:'blast', r:5}},
|
{id:'baby-missile', name:'Baby Missile', explosion:{type:'blast', r:5}},
|
||||||
{id:'missile', name:'Missile', explosion:{type:'blast', r:10}},
|
{id:'missile', name:'Missile', explosion:{type:'blast', r:10}},
|
||||||
@@ -73,11 +77,11 @@ export const EXPLOSION_TYPES = {
|
|||||||
const f = explosion.cr % 2 === 0 ? 220 + explosion.cr : 0;
|
const f = explosion.cr % 2 === 0 ? 220 + explosion.cr : 0;
|
||||||
osc.frequency.setValueAtTime(f, audio.currentTime);
|
osc.frequency.setValueAtTime(f, audio.currentTime);
|
||||||
osc.frequency.setValueAtTime(0, audio.currentTime+0.1);
|
osc.frequency.setValueAtTime(0, audio.currentTime+0.1);
|
||||||
drawExplosion(foreground, x, y, cr);
|
drawDirt(foreground, x, y, cr);
|
||||||
},
|
},
|
||||||
clip(explosion, terrain) {
|
clip(explosion, terrain) {
|
||||||
const {x, y, cr} = explosion;
|
const {x, y, cr} = explosion;
|
||||||
drawExplosion(terrain, x, y, cr);
|
drawDirt(terrain, x, y, cr);
|
||||||
},
|
},
|
||||||
damage(explosion, player) {}
|
damage(explosion, player) {}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user