act ii chars

This commit is contained in:
Nicky Case 2019-06-11 14:31:28 -04:00
parent e431517d12
commit 77336a08b6
12 changed files with 221 additions and 10 deletions

View File

@ -277,5 +277,7 @@ ACT I
<script src="scripts/act2/Act2_SceneSetup.js"></script>
<script src="scripts/act2/Act2_BG.js"></script>
<script src="scripts/act2/Act2_Hong.js"></script>
<script src="scripts/act2/Act2_Beebee.js"></script>
<script src="scripts/main.js"></script>

View File

@ -1,6 +1,27 @@
/*****
TODO:
- whoosh out @done
- put hong & beebee sprites in for battle @done
- characters in @done
TODO:
- battle talk
- whoosh in
- party talk
- whoosh out
- battle talk 2
- jarring image
- whoosh in
- slap dat/run out
- whoosh out
****/
Loader.addImages([
{ id:"party_bg", src:"sprites/act2/party_bg.png" },
{ id:"party_action", src:"sprites/act2/party_action.png" },
{ id:"hong_bb_outro", src:"sprites/act2/hong_bb_outro.png" },
]);
function BG_Party(){
@ -13,31 +34,50 @@ function BG_Party(){
grid:{ width:1, height:1 },
frame:{ width:720, height:1200 },
});
self.actionSprite = new Sprite({
self.partyActionSprite = new Sprite({
image: Library.images.party_action,
grid:{ width:4, height:3 },
frame:{ width:720, height:600 },
y: 189
});
self.outroSprite = new Sprite({
image: Library.images.hong_bb_outro,
grid:{ width:4, height:2 },
frame:{ width:720, height:400 },
y: 260
});
// Anxiety BG
self.anxiety = new BG_Anxiety();
// Characters
self.hong = new Act2_Hong();
self.beebee = new Act2_Beebee();
// LAYERS
self.layers = [
self.bgSprite,
self.anxiety,
self.actionSprite
self.partyActionSprite,
self.outroSprite,
self.hong,
self.beebee,
];
var PARALLAXES = [
0.5, // party bg
0.0, // anxiety bg
1.0, // hong & hunter
1.0, // PARTY ACTION SPRITE
0.0, // OUTRO hong & bb
0.0, // battle hong
0.0, // battle beebee
];
var ALPHAS = [
1.0, // party bg
0.0, // anxiety bg
1.0, // hong & hunter
1.0, // PARTY ACTION SPRITE
0.0, // OUTRO hong & bb
0.0, // battle hong
0.0, // battle beebee
];
var parallax = 0;
@ -68,6 +108,20 @@ function BG_Party(){
// DONE
if(t==1 || t==0){
PARALLAXING = null;
// Stage 1 transition end
if(STAGE==1){
ALPHAS[2] = 0; // Party Action
ALPHAS[4] = 1; // Hong
ALPHAS[5] = 1; // Beebee
}
// Stage 5 transition end
if(STAGE==5){
ALPHAS[2] = 0; // Party Action
ALPHAS[3] = 1; // OUTRO Action
}
}
}
@ -101,27 +155,31 @@ function BG_Party(){
};
var STAGE = 0;
var _subscriptions = [];
_subscriptions.push(
subscribe("act2-out-1", function(){
STAGE = 1;
PARALLAXING = "out";
sfx("whoosh"); // WHOOSH
}),
subscribe("act2-in-2", function(){
STAGE = 2;
PARALLAXING = "in";
sfx("whoosh"); // WHOOSH
}),
subscribe("act2-out-3", function(){
// WHOOSH
sfx("whoosh");
STAGE = 3;
sfx("whoosh"); // WHOOSH
}),
subscribe("act2-in-4", function(){
// WHOOSH
sfx("whoosh");
STAGE = 4;
sfx("whoosh"); // WHOOSH
}),
subscribe("act2-out-5", function(){
// WHOOSH
sfx("whoosh");
STAGE = 5;
PARALLAXING = "out";
sfx("whoosh"); // WHOOSH
})
);

View File

@ -0,0 +1,82 @@
Loader.addImages([
{ id:"act2_bb", src:"sprites/act2/battle_bb.png" }
]);
function Act2_Beebee(){
var self = this;
// SPRITE CONFIG!
var spriteConfig = {
image: Library.images.act2_bb,
grid:{
width: 4,
height: 3
},
frame:{
width: 720,
height: 400
},
anchor:{
x: 306,
y: 188
},
frameNames:[
"body_neutral*",
"body_sad*",
"body_happy*",
"body_yell*",
"body_cry*",
"body_shock*",
"body_attacked*",
"body_pained*",
"body_special_1*",
"body_special_2*",
"eyes_blank",
"mouth_blank",
],
x: 306,
y: 258+188
};
// ANIM LOOPS
var animLoops = [];
// Inherit from Character!
Character.apply(self, [spriteConfig, animLoops]);
// Go To Frames!
self.gotoFrames({
body: "neutral",
mouth: "blank",
eyes: "blank",
});
var _subscriptions = [];
_subscriptions.push( subscribe("bb", self.gotoFrames) );
// Draw! Same as earlier except a lot of vibration
var ticker = 0;
var _oldDraw = self.draw;
self.characterSpeakerID = "b";
self.bounceHookes = 0.25; // loose
self.bounceDamp = 0.9; // loose
self.draw = function(ctx){
// Vibration!
ticker += 1/60;
self.characterSquash = 1 + Math.sin(ticker*Math.TAU*7)*0.01; // seven vibes per second
// Old Draw
_oldDraw.apply(self, arguments);
};
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Kill!
self.kill = function(){
_subscriptions.forEach(unsubscribe);
};
}

69
scripts/act2/Act2_Hong.js Normal file
View File

@ -0,0 +1,69 @@
Loader.addImages([
{ id:"act2_hong", src:"sprites/act2/battle_hong.png" }
]);
function Act2_Hong(){
var self = this;
// SPRITE CONFIG!
var spriteConfig = {
image: Library.images.act2_hong,
grid:{
width: 4,
height: 3
},
frame:{
width: 720,
height: 400
},
anchor:{
x: 66,
y: 188
},
frameNames:[
"body_ignore*",
"body_ignore_sweat*",
"body_attacked*",
"body_yell*",
"body_cry*",
"body_hold_alcohol*",
"body_drinking*",
"body_drunk*",
"body_defeated*",
"mouth_blank",
"eyes_blank",
],
x: 66,
y: 258+188
};
// ANIM LOOPS
var animLoops = [];
// Inherit from Character!
Character.apply(self, [spriteConfig, animLoops]);
// Go To Frames!
self.gotoFrames({
body: "ignore",
mouth: "blank",
eyes: "blank",
});
var _subscriptions = [];
_subscriptions.push( subscribe("hong", self.gotoFrames) );
_subscriptions.push( subscribe("attack_hong", self.showAttackedIcon) );
// Draw
self.characterSpeakerID = "h";
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Kill!
self.kill = function(){
_subscriptions.forEach(unsubscribe);
};
}

BIN
sprites/act2/battle_bb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
sprites/act2/special.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

View File

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB