diff --git a/index.html b/index.html index 5effc5b..3db79fc 100644 --- a/index.html +++ b/index.html @@ -277,5 +277,7 @@ ACT I + + \ No newline at end of file diff --git a/scripts/act2/Act2_BG.js b/scripts/act2/Act2_BG.js index 4394f4e..3110ef3 100644 --- a/scripts/act2/Act2_BG.js +++ b/scripts/act2/Act2_BG.js @@ -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 }) ); diff --git a/scripts/act2/Act2_Beebee.js b/scripts/act2/Act2_Beebee.js new file mode 100644 index 0000000..2b5ca53 --- /dev/null +++ b/scripts/act2/Act2_Beebee.js @@ -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); + }; + +} \ No newline at end of file diff --git a/scripts/act2/Act2_Hong.js b/scripts/act2/Act2_Hong.js new file mode 100644 index 0000000..375f6a6 --- /dev/null +++ b/scripts/act2/Act2_Hong.js @@ -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); + }; + +} \ No newline at end of file diff --git a/sprites/act2/battle_bb.png b/sprites/act2/battle_bb.png new file mode 100644 index 0000000..327a958 Binary files /dev/null and b/sprites/act2/battle_bb.png differ diff --git a/sprites/act2/battle_hong.png b/sprites/act2/battle_hong.png new file mode 100644 index 0000000..6ad3ad3 Binary files /dev/null and b/sprites/act2/battle_hong.png differ diff --git a/sprites/act2/hong_bb_outro.png b/sprites/act2/hong_bb_outro.png new file mode 100644 index 0000000..f332877 Binary files /dev/null and b/sprites/act2/hong_bb_outro.png differ diff --git a/sprites/act2/special.png b/sprites/act2/special.png new file mode 100644 index 0000000..6fed8a6 Binary files /dev/null and b/sprites/act2/special.png differ diff --git a/sprites/act2/special/harm.png b/sprites/act2/special/0.png similarity index 100% rename from sprites/act2/special/harm.png rename to sprites/act2/special/0.png diff --git a/sprites/act2/special/alone.png b/sprites/act2/special/1.png similarity index 100% rename from sprites/act2/special/alone.png rename to sprites/act2/special/1.png diff --git a/sprites/act2/special/bad.png b/sprites/act2/special/2.png similarity index 100% rename from sprites/act2/special/bad.png rename to sprites/act2/special/2.png diff --git a/sprites/act2/special/special.png b/sprites/act2/special/special.png new file mode 100644 index 0000000..6fed8a6 Binary files /dev/null and b/sprites/act2/special/special.png differ