Add locked gore death and enemy health pips
This commit is contained in:
1 parent
2f1769a528
commit
0eab705ed3
9 files changed
+153
-20
No files matched your search
+15
-1
@@ -48,7 +48,7 @@ const SPRITE_MANIFEST = [
|
||||
'a_bonenova', 'a_offalbomb', 'a_bloodtransfusion', 'a_cleaverstorm', 'a_butchersbell',
|
||||
'a_marrowdraught', 'a_slaughtertime', 'a_panicroom', 'a_skinnerscoin', 'a_gutreroll',
|
||||
// full 64px/128px eight-direction action atlases
|
||||
'player_sheet', 'player_legs_sheet',
|
||||
'player_sheet', 'player_legs_sheet', 'player_death_sheet',
|
||||
'enemy_shambler_sheet', 'enemy_runner_sheet', 'enemy_spitter_sheet',
|
||||
'enemy_splitter_sheet', 'enemy_mini_sheet', 'enemy_exploder_sheet',
|
||||
'boss_bonesaw_sheet', 'boss_gorecrown_sheet', 'boss_knifecrawl_sheet',
|
||||
@@ -111,6 +111,20 @@ const Sprites = {
|
||||
ctx.restore();
|
||||
},
|
||||
|
||||
// Non-directional one-row effects such as the player's authored gore burst.
|
||||
strip(ctx, name, x, y, time, frames, fps, frameSize, targetW, hold) {
|
||||
const sheet = this.imgs[name];
|
||||
if (!sheet) {
|
||||
this.actor(ctx, 'player', x, y, 0, 'death', time, targetW || frameSize);
|
||||
return;
|
||||
}
|
||||
const raw = Math.floor(Math.max(0, time) * fps);
|
||||
const frame = hold ? Math.min(frames - 1, raw) : raw % frames;
|
||||
const tw = targetW || frameSize;
|
||||
ctx.drawImage(sheet, frame * frameSize, 0, frameSize, frameSize,
|
||||
x - tw / 2, y - tw / 2, tw, tw);
|
||||
},
|
||||
|
||||
actor(ctx, name, x, y, facing, action, time, targetW, alpha, scaleX, scaleY) {
|
||||
const sheet = this.imgs[name + '_sheet'];
|
||||
const def = ACTOR_ANIMS[action] || ACTOR_ANIMS.idle;
|
||||
|
||||
Reference in new issue
Block a user