Add blood splats

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 15:20:31 -08:00
parent 12d317e4c8
commit 57b67ce952

View File

@ -372,6 +372,14 @@ export class AnimalEntity extends Entity {
this.dead = true this.dead = true
let force = -1 + Math.random() * 2 let force = -1 + Math.random() * 2
let dir = Math.random() * 320 let dir = Math.random() * 320
// 100% random blood splat
ctx.addEntity(new GibletEntity(`giblets.any.blood${Math.floor(1+Math.random()*4)}.default.0`, dir+Math.random()*10, force+Math.random()*2, 30000), 'gibs', p[0], p[1])
// 50% extra blood change
if (Math.random() > 0.5) {
ctx.addEntity(new GibletEntity(`giblets.any.blood${Math.floor(1+Math.random()*4)}.default.0`, dir+Math.random()*10, force+Math.random()*2, 20000), 'gibs', p[0], p[1])
}
// 50% head gib // 50% head gib
if (Math.random() > 0.5) { if (Math.random() > 0.5) {
ctx.addEntity(new GibletEntity(`giblets.${this.sprite.spriteKey}.head.default.0`, dir+Math.random()*40, force+Math.random()*10), 'gibs', p[0], p[1]) ctx.addEntity(new GibletEntity(`giblets.${this.sprite.spriteKey}.head.default.0`, dir+Math.random()*40, force+Math.random()*10), 'gibs', p[0], p[1])