cutscene
This commit is contained in:
parent
e7909ad910
commit
db84260f45
BIN
docs/assets/images/slep.png
Normal file
BIN
docs/assets/images/slep.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
62
docs/assets/js/cutscene/cutscene.js
Normal file
62
docs/assets/js/cutscene/cutscene.js
Normal file
@ -0,0 +1,62 @@
|
||||
var lightY = -300;
|
||||
var vel = 1;
|
||||
|
||||
function drawCutScene() {
|
||||
if (cutTime < 135) {
|
||||
imgIgnoreCutoff(sprites.slep, 0, 0);
|
||||
imgIgnoreCutoff(sprites.chandelier, 770, lightY, 0, 4, 4);
|
||||
} else {
|
||||
camera.x = 0;
|
||||
camera.y = 0;
|
||||
difx = 0;
|
||||
dify = 0;
|
||||
rect(cw / 2, ch / 2, cw, ch, "black");
|
||||
text("Mike Died", 300, 50, "#992929", 4);
|
||||
text("Thanks for playing!", 200, 100, "#992929", 4);
|
||||
}
|
||||
}
|
||||
|
||||
var cutTime = 0;
|
||||
function updateCutScene() {
|
||||
cutTime++;
|
||||
if (cutTime < 135) {
|
||||
if (cutTime > 50 && cutTime < 58) {
|
||||
lightY += 2;
|
||||
}
|
||||
|
||||
if (cutTime > 100) {
|
||||
lightY += vel;
|
||||
vel += 0.1;
|
||||
}
|
||||
}
|
||||
if (cutTime >= 500) {
|
||||
globalState = globalStates.titleScreen;
|
||||
titleScreenState = "credits";
|
||||
player = new Player(constants.player.defaultX, constants.player.defaultY);
|
||||
|
||||
// why does this stop the legs from glitching on the first step???
|
||||
player.rightLeg.angle = -pointTo({ x: player.rightLeg.x2, y: player.rightLeg.y2 }, player.hipRight);
|
||||
player.leftLeg.angle = pointTo({ x: player.leftLeg.x2, y: player.leftLeg.y2 }, player.hipLeft);
|
||||
player.moveLeg();
|
||||
|
||||
Objectives = [];
|
||||
Objectives.push(new Objective(-140,108,60,300,"cereal",function(){console.log("%c cereal obtained 😎","font-size:200%;");tutState = tutorialStates.getMail;}));
|
||||
Objectives.push(new Objective(-740,156,50,50,"box",function(){console.log("%c the entire mailbox obtained 😎","font-size:200%;");player.holdingBox = true;}));
|
||||
|
||||
playingUIOffsets = {
|
||||
heart: 100,
|
||||
breath: 100,
|
||||
blink: 100
|
||||
};
|
||||
|
||||
tutState = tutorialStates.selectLeg;
|
||||
|
||||
breath = 200;
|
||||
pressure = 55;
|
||||
fullBreathTimer = 0;
|
||||
noBreathTimer = 0;
|
||||
heartBeat = false;
|
||||
currentBreathMode = breathMode.inhale;
|
||||
eyeDryness = 0;
|
||||
}
|
||||
}
|
@ -39,7 +39,8 @@ images = [
|
||||
"buttonSmallHover.png",
|
||||
"buttonSmall.png",
|
||||
"backGround.png",
|
||||
"turn.png"
|
||||
"turn.png",
|
||||
"slep.png"
|
||||
];
|
||||
|
||||
audio = [
|
||||
@ -78,7 +79,7 @@ function update() {
|
||||
break;
|
||||
// end
|
||||
case globalStates.end:
|
||||
|
||||
updateCutScene();
|
||||
break;
|
||||
//building - to be used only in development
|
||||
case globalStates.building:
|
||||
@ -111,11 +112,10 @@ function draw() {
|
||||
break;
|
||||
// dead
|
||||
case globalStates.dead:
|
||||
|
||||
break;
|
||||
// end
|
||||
case globalStates.end:
|
||||
|
||||
drawCutScene();
|
||||
break;
|
||||
//building - to be used only in development
|
||||
case globalStates.building:
|
||||
|
@ -54,5 +54,4 @@ function drawLevelTransitionUI() {
|
||||
|
||||
// resets alpha for rest of drawing
|
||||
canvases.ctx.globalAlpha = 1;
|
||||
|
||||
}
|
||||
|
@ -79,6 +79,8 @@ Matthew West
|
||||
<script src="assets/js/UI/dead.js"></script>
|
||||
<script src="assets/js/transition/transition.js"></script>
|
||||
|
||||
<script src="assets/js/cutscene/cutscene.js"></script>
|
||||
|
||||
<!-- Webpage -->
|
||||
<script src="assets/js/injection/cssinjector.js"></script>
|
||||
<script src="assets/js/preloader/preloader.js"></script>
|
||||
|
Reference in New Issue
Block a user