anxiety/scripts/act1/Act1_Hong.js

108 lines
2.2 KiB
JavaScript
Raw Normal View History

2019-04-09 18:59:19 +00:00
Loader.addImages([
2019-04-18 11:40:22 +00:00
{ id:"act1_hong", src:"sprites/act1/act1_hong.png" }
2019-04-09 18:59:19 +00:00
]);
2019-02-22 23:48:24 +00:00
function Act1_Hong(){
2019-02-18 17:24:52 +00:00
var self = this;
2019-04-18 11:40:22 +00:00
// SPRITE CONFIG!
var spriteConfig = {
2019-02-22 23:48:24 +00:00
image: Library.images.act1_hong,
2019-02-18 17:24:52 +00:00
grid:{
2019-02-18 20:59:10 +00:00
width: 4,
2019-04-11 18:44:15 +00:00
height: 10
2019-02-18 17:24:52 +00:00
},
frame:{
2019-04-11 18:44:15 +00:00
width: 720,
height: 500
2019-02-18 17:24:52 +00:00
},
anchor:{
2019-04-11 18:44:15 +00:00
x: 122/2,
y: 404/2
2019-02-18 17:24:52 +00:00
},
frameNames:[
2019-04-11 18:44:15 +00:00
2019-04-18 11:40:22 +00:00
"body_0_sammich_no_outline",
"body_0_sammich",
"eyes_0_neutral",
2019-04-19 15:57:10 +00:00
"eyes_0_lookaway",
"eyes_0_annoyed",
2019-04-18 11:40:22 +00:00
"eyes_0_shock",
"mouth_0_neutral",
"mouth_0_chew1",
"mouth_0_chew2",
"mouth_0_neutral_talk",
"mouth_0_shock",
"body_putaway*",
2019-04-11 18:44:15 +00:00
"body_phone1",
"body_phone2",
"eyes_neutral",
"eyes_annoyed",
"eyes_sad",
"eyes_shock",
"eyes_lookaway",
"eyes_anger",
"eyes_surprise",
2019-04-19 15:57:10 +00:00
"mouth_shut",
2019-04-11 18:44:15 +00:00
"mouth_neutral",
"mouth_neutral_talk",
"mouth_smile",
"mouth_smile_talk",
"mouth_sad",
"mouth_sad_talk",
"mouth_shock",
"mouth_anger",
"mouth_anger_talk",
2019-04-18 11:40:22 +00:00
"body_2_tired*",
"body_2_fuck*",
"body_2_you*",
"body_2_sammich_eat*",
"body_2_sammich_eaten",
2019-04-11 18:44:15 +00:00
2019-04-18 11:40:22 +00:00
"body_3_defeated1*",
"body_3_defeated2*",
"body_3_defeated3*",
"body_3_defeated3_no_outline*"
2019-04-11 18:44:15 +00:00
2019-02-18 17:24:52 +00:00
],
2019-04-11 18:44:15 +00:00
x: 65,
2019-04-18 11:40:22 +00:00
y: 385+14
};
// ANIM LOOPS
var animLoops = [
2019-04-19 15:57:10 +00:00
{ target:"body", ifOnFrame:"phone1", wait:1, thenGoToFrame:"phone2" },
{ target:"body", ifOnFrame:"phone2", wait:1, thenGoToFrame:"phone1" },
{ target:"mouth", ifOnFrame:"0_chew1", wait:0.7, thenGoToFrame:"0_chew2" },
{ target:"mouth", ifOnFrame:"0_chew2", wait:0.7, thenGoToFrame:"0_chew1" }
2019-04-18 11:40:22 +00:00
];
// Inherit from Character!
Character.apply(self, [spriteConfig, animLoops]);
// Go To Frames!
self.gotoFrames({
2019-04-19 15:57:10 +00:00
body: "0_sammich",
mouth: "0_chew1",
eyes: "0_neutral",
2019-02-18 17:24:52 +00:00
});
2019-04-18 11:40:22 +00:00
var _subscriptions = [];
_subscriptions.push( subscribe("hong", self.gotoFrames) );
_subscriptions.push( subscribe("attack_hong", self.showAttackedIcon) );
2019-02-18 17:24:52 +00:00
2019-04-18 11:40:22 +00:00
// Draw
2019-04-19 15:57:10 +00:00
self.characterSpeakerID = "h";
2019-04-18 11:40:22 +00:00
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Kill!
self.kill = function(){
_subscriptions.forEach(unsubscribe);
};
2019-02-18 17:24:52 +00:00
}