Compare commits
7 Commits
creditUpda
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
22e30696b0 | ||
|
db2fd2d3ed | ||
|
db84260f45 | ||
|
e7909ad910 | ||
|
db800eea27 | ||
|
aea12aeaa2 | ||
|
5196dcf778 |
BIN
docs/assets/images/backGround.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/assets/images/buttonBig.png
Normal file
After Width: | Height: | Size: 548 B |
BIN
docs/assets/images/buttonBigHover.png
Normal file
After Width: | Height: | Size: 551 B |
BIN
docs/assets/images/buttonSmall.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
docs/assets/images/buttonSmallHover.png
Normal file
After Width: | Height: | Size: 417 B |
BIN
docs/assets/images/slep.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
docs/assets/images/thumb.png
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
docs/assets/images/turn.png
Normal file
After Width: | Height: | Size: 243 B |
43
docs/assets/js/UI/dead.js
Normal file
@ -0,0 +1,43 @@
|
||||
function deadUI() {
|
||||
rect(cw/2,ch/2,cw,ch,"black");
|
||||
text("Mike Died", 300, 50, "#992929", 4);
|
||||
text("maybe try to keep your heart beating, also it doesn't hurt to breath occasionally ", 250, 100, "white", 2, 400);
|
||||
|
||||
img(sprites["buttonBig" + (rectpoint({ x: 400, y: 550, w: 300, h: 50 }, mousePos) ? "Hover" : "")], 400, 550, 0, 2, 2);
|
||||
text("time travel back", 260, 540, "#403826", 3);
|
||||
}
|
||||
|
||||
function handleDead() {
|
||||
|
||||
if(rectpoint({ x: 400, y: 550, w: 300, h: 50 }, mousePos) && mousePress[0]) {
|
||||
soundAssets.click.play();
|
||||
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;
|
||||
|
||||
globalState = globalStates.levelTransition;
|
||||
}
|
||||
}
|
@ -26,13 +26,22 @@ function drawPlayingUI() {
|
||||
|
||||
switch(tutState) {
|
||||
case tutorialStates.getCereal:
|
||||
text("Objective: eat breakfast",10,ch-30,"black",2);
|
||||
curCtx.globalAlpha = 0.5;
|
||||
rect(150,ch-15,300,30,"white");
|
||||
curCtx.globalAlpha = 1;
|
||||
text("Objective: eat breakfast",10,ch-25,"black",2);
|
||||
break;
|
||||
case tutorialStates.getMail:
|
||||
text("Objective: bring in the mail",10,ch-30,"black",2);
|
||||
curCtx.globalAlpha = 0.5;
|
||||
rect(170,ch-15,340,30,"white");
|
||||
curCtx.globalAlpha = 1;
|
||||
text("Objective: bring in the mail",10,ch-25,"black",2);
|
||||
break;
|
||||
case tutorialStates.goToBed:
|
||||
text("Objective: go back to bed",10,ch-30,"black",2);
|
||||
curCtx.globalAlpha = 0.5;
|
||||
rect(150,ch-15,300,30,"white");
|
||||
curCtx.globalAlpha = 1;
|
||||
text("Objective: go back to bed",10,ch-25,"black",2);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -76,10 +85,6 @@ function drawPlayingUI() {
|
||||
curCtx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
//UI for pause screen
|
||||
function drawPausedUI() {
|
||||
}
|
||||
|
||||
//UI for game end
|
||||
function drawEndUI() {
|
||||
}
|
||||
@ -147,11 +152,11 @@ function heartBeatUI(x, y, width, height) {
|
||||
//Backdrop
|
||||
var BackdropColor;
|
||||
if (pressure > 42 && pressure < 60) {
|
||||
BackdropColor = "#0c2605";
|
||||
BackdropColor = "#398026";
|
||||
} else if (pressure > 28 && pressure < 75) {
|
||||
BackdropColor = "#2b2b06";
|
||||
BackdropColor = "#9e9e2e";
|
||||
} else {
|
||||
BackdropColor = "#260505";
|
||||
BackdropColor = "#d42828";
|
||||
}
|
||||
rect(x + width / 2, y + height / 2, width, height, BackdropColor);
|
||||
img(sprites.heartBack, cw - 107, ch - 46 + playingUIOffsets.heart);
|
||||
|
@ -59,8 +59,8 @@ var constants = {
|
||||
offset_x: 16,
|
||||
offset_y: 35
|
||||
},
|
||||
defaultX: 600,
|
||||
defaultY: -170
|
||||
defaultX: 535,
|
||||
defaultY: -155
|
||||
}
|
||||
|
||||
};
|
68
docs/assets/js/cutscene/cutscene.js
Normal file
@ -0,0 +1,68 @@
|
||||
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===52) {
|
||||
soundAssets.crack.play();
|
||||
}
|
||||
if(cutTime===140) {
|
||||
soundAssets.crash.play();
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
@ -33,7 +33,14 @@ images = [
|
||||
"lungs.png",
|
||||
"lungCover.png",
|
||||
"lungBack.png",
|
||||
"chandelier.png"
|
||||
"chandelier.png",
|
||||
"buttonBigHover.png",
|
||||
"buttonBig.png",
|
||||
"buttonSmallHover.png",
|
||||
"buttonSmall.png",
|
||||
"backGround.png",
|
||||
"turn.png",
|
||||
"slep.png"
|
||||
];
|
||||
|
||||
audio = [
|
||||
@ -44,7 +51,7 @@ var globalStates = {
|
||||
titleScreen: 0,
|
||||
levelTransition: 1,
|
||||
playing: 2,
|
||||
paused: 3,
|
||||
dead: 3,
|
||||
end: 4,
|
||||
building: 5
|
||||
};
|
||||
@ -66,13 +73,13 @@ function update() {
|
||||
handlePlaying();
|
||||
player.update();
|
||||
break;
|
||||
// paused
|
||||
case globalStates.paused:
|
||||
|
||||
// dead
|
||||
case globalStates.dead:
|
||||
handleDead();
|
||||
break;
|
||||
// end
|
||||
case globalStates.end:
|
||||
|
||||
updateCutScene();
|
||||
break;
|
||||
//building - to be used only in development
|
||||
case globalStates.building:
|
||||
@ -82,7 +89,6 @@ function update() {
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
// If draw is being called, the user has interacted with the page at least once.
|
||||
// This signal can be used to notify the audio permission handler
|
||||
unlockAudioPermission();
|
||||
@ -103,13 +109,12 @@ function draw() {
|
||||
case globalStates.playing:
|
||||
drawPlaying();
|
||||
break;
|
||||
// paused
|
||||
case globalStates.paused:
|
||||
|
||||
// dead
|
||||
case globalStates.dead:
|
||||
break;
|
||||
// end
|
||||
case globalStates.end:
|
||||
|
||||
drawCutScene();
|
||||
break;
|
||||
//building - to be used only in development
|
||||
case globalStates.building:
|
||||
@ -133,9 +138,9 @@ function absoluteDraw() {
|
||||
case globalStates.playing:
|
||||
drawPlayingUI();
|
||||
break;
|
||||
// paused
|
||||
case globalStates.paused:
|
||||
drawPausedUI();
|
||||
// dead
|
||||
case globalStates.dead:
|
||||
deadUI();
|
||||
break;
|
||||
// end
|
||||
case globalStates.end:
|
||||
|
@ -53,6 +53,11 @@ function updateLife() {
|
||||
}
|
||||
|
||||
pressure -= 0.1;
|
||||
if(~~(pressure*10)/10 === 28) {
|
||||
soundAssets.beep2.play();
|
||||
} else if(~~(pressure*10)/10 === 42){
|
||||
soundAssets.beep1.play();
|
||||
}
|
||||
if (pressure <= 0) {
|
||||
pressure = 0;
|
||||
player.die();
|
||||
@ -135,6 +140,11 @@ function heartbeat() {
|
||||
pressure = 100;
|
||||
player.die();
|
||||
}
|
||||
if(pressure>75) {
|
||||
soundAssets.beep2.play();
|
||||
} else if(pressure>60){
|
||||
soundAssets.beep1.play();
|
||||
}
|
||||
heartBeat = true;
|
||||
|
||||
// Play the heartbeat sound
|
||||
|
@ -6,8 +6,8 @@ class Player {
|
||||
this.h = constants.player.height;
|
||||
this.hipLeft = { x: this.x + constants.player.hip.offset_x, y: this.y + constants.player.hip.offset_y };
|
||||
this.hipRight = { x: this.x - constants.player.hip.offset_x, y: this.y + constants.player.hip.offset_y };
|
||||
this.leftLeg = new Leg(this.hipLeft.x, this.hipLeft.y, constants.player.leg_length, Math.PI*2.5);
|
||||
this.rightLeg = new Leg(this.hipRight.x, this.hipRight.y, constants.player.leg_length, Math.PI*2.5);
|
||||
this.leftLeg = new Leg(this.hipLeft.x, this.hipLeft.y, constants.player.leg_length, 1.5);
|
||||
this.rightLeg = new Leg(this.hipRight.x, this.hipRight.y, constants.player.leg_length, 1.5);
|
||||
this.leftArm = new Arm(this.hipLeft.x + 8, this.y - constants.player.hip.offset_y, 64, Math.PI/2);
|
||||
this.rightArm = new Arm(this.hipRight.x - 8, this.y - constants.player.hip.offset_y, 64, Math.PI/2);
|
||||
this.head = {x:this.x,y:this.y-this.h/2,angle:Math.PI*1.5};
|
||||
@ -38,6 +38,8 @@ Player.prototype.getLockedLeg = function(){
|
||||
}
|
||||
|
||||
Player.prototype.die = function() {
|
||||
soundAssets.dead.play();
|
||||
globalState = globalStates.dead;
|
||||
console.warn("player is big ded, rip");
|
||||
}
|
||||
|
||||
@ -67,32 +69,43 @@ Player.prototype.update = function() {
|
||||
|
||||
var targetPos = mousePosition();
|
||||
var curLeg = this.getActiveLeg();
|
||||
this.hover.active = false;
|
||||
|
||||
// right
|
||||
if (distanceToLineSegment(this.rightLeg.x, this.rightLeg.y, this.rightLeg.x2, this.rightLeg.y2, targetPos.x, targetPos.y) < constants.player.select_range) {
|
||||
if(this.hover.active === false) {
|
||||
soundAssets.hover.play();
|
||||
}
|
||||
this.hover.active = true;
|
||||
this.hover.leg = "R";
|
||||
if(mousePress[0]) {
|
||||
this.shouldMoveLeg = true;
|
||||
this.legSelected = "R";
|
||||
this.hover.active = false;
|
||||
soundAssets.selectLeg.play();
|
||||
}
|
||||
//left
|
||||
} else if (distanceToLineSegment(this.leftLeg.x, this.leftLeg.y, this.leftLeg.x2, this.leftLeg.y2, targetPos.x, targetPos.y) < constants.player.select_range) {
|
||||
if(this.hover.active === false) {
|
||||
soundAssets.hover.play();
|
||||
}
|
||||
this.hover.active = true;
|
||||
this.hover.leg = "L";
|
||||
if(mousePress[0]) {
|
||||
this.shouldMoveLeg = true;
|
||||
this.legSelected = "L";
|
||||
this.hover.active = false;
|
||||
soundAssets.selectLeg.play();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.hover.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
// place box
|
||||
if(this.holdingBox && this.x > -275 && this.y < 100) {
|
||||
this.holdingBox = false;
|
||||
boxOnTable = true;
|
||||
soundAssets.clonk.play();
|
||||
}
|
||||
|
||||
// god mode
|
||||
@ -180,6 +193,10 @@ Player.prototype.moveLeg = function(){
|
||||
|
||||
// console.log(curLeg.angle.toPrecision(5),pointTo(curLeg,target).toPrecision(5));
|
||||
var angleDif = turn(curLeg.angle, pointTo(curLeg, target), constants.player.leg_speed) - curLeg.angle;
|
||||
if(Math.abs(angleDif) > 1) {
|
||||
curLeg.angle = pointTo(curLeg, target);
|
||||
angleDif = 0;
|
||||
}
|
||||
curLeg.angle += angleDif;
|
||||
curLeg.x2 = curLeg.x + curLeg.len * Math.cos(curLeg.angle);
|
||||
curLeg.y2 = curLeg.y + curLeg.len * Math.sin(curLeg.angle);
|
||||
|
@ -15,6 +15,10 @@ Objective.prototype.draw = function() {
|
||||
|
||||
Objective.prototype.update = function() {
|
||||
if(rectrect(this,player)) {
|
||||
for(var j=0;j<50;j++) {
|
||||
Particles.push(new Particle(this.x,this.y));
|
||||
}
|
||||
soundAssets.pickUp.play();
|
||||
this.callback();
|
||||
return true;
|
||||
}
|
||||
|
42
docs/assets/js/playing/particles.js
Normal file
@ -0,0 +1,42 @@
|
||||
class Particle {
|
||||
constructor(x,y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.size = rand(2,8);
|
||||
var angle = rand(0,2262)/360;
|
||||
var speed = rand(5,10);
|
||||
this.vel = {x:Math.cos(angle) * speed,y:Math.sin(angle) * speed};
|
||||
this.timer = rand(50,150);
|
||||
}
|
||||
}
|
||||
|
||||
Particle.prototype.draw = function() {
|
||||
rect(this.x,this.y,this.size,this.size,"#baba30");
|
||||
}
|
||||
|
||||
Particle.prototype.update = function() {
|
||||
if(this.timer <= 0) {
|
||||
return true;
|
||||
}
|
||||
--this.timer;
|
||||
this.x += this.vel.x;
|
||||
this.y += this.vel.y;
|
||||
this.vel.y += 0.1;
|
||||
return false;
|
||||
}
|
||||
|
||||
var Particles = [];
|
||||
function updateParticles() {
|
||||
for(var i=0;i<Particles.length;i++) {
|
||||
if(Particles[i].update()) {
|
||||
Particles.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawParticles() {
|
||||
for(var i=0;i<Particles.length;i++) {
|
||||
Particles[i].draw();
|
||||
}
|
||||
}
|
@ -48,13 +48,13 @@ function handlePlaying() {
|
||||
case tutorialStates.getCereal:
|
||||
break;
|
||||
case tutorialStates.getMail:
|
||||
if(!player.holdingBox) {
|
||||
if(boxOnTable) {
|
||||
tutState = tutorialStates.goToBed;
|
||||
}
|
||||
break;
|
||||
case tutorialStates.goToBed:
|
||||
if(player.x > 560) {
|
||||
|
||||
globalState = globalStates.end;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -81,6 +81,7 @@ function handlePlaying() {
|
||||
}
|
||||
|
||||
updateLife();
|
||||
updateParticles();
|
||||
updateObjectives();
|
||||
}
|
||||
|
||||
@ -90,13 +91,28 @@ function drawPlaying() {
|
||||
|
||||
imgIgnoreCutoff(sprites.epic,0,0);
|
||||
imgIgnoreCutoff(sprites.post,-740,156,0,4,4);
|
||||
imgIgnoreCutoff(sprites.chandelier,770,-235,0,4,4);
|
||||
imgIgnoreCutoff(sprites.chandelier,770,-300,0,4,4);
|
||||
|
||||
if(boxOnTable) {
|
||||
imgIgnoreCutoff(sprites.boxNoOutline,-140,116,0,4,4);
|
||||
}
|
||||
|
||||
drawParticles();
|
||||
|
||||
// drawWorldBlocks();
|
||||
player.draw();
|
||||
|
||||
if(player.shouldMoveLeg) {
|
||||
curCtx.globalAlpha = 0.3;
|
||||
curCtx.lineCap = "round";
|
||||
curCtx.shadowColor = "yellow";
|
||||
curCtx.shadowBlur = 10;
|
||||
line(player.x,player.y,mousePosition().x,mousePosition().y,2*clamp(dist(player.getActiveLeg(), mousePosition()) / constants.player.movement_divider, 0.1, constants.player.max_movement_speed),"#baba30");
|
||||
curCtx.shadowBlur = 0;
|
||||
curCtx.shadowColor = "black";
|
||||
curCtx.lineCap = "butt";
|
||||
curCtx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
// beat key
|
||||
if(keyPrompts.beat > 0 && playingUIOffsets.heart === 0) {
|
||||
@ -123,7 +139,8 @@ function drawPlaying() {
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],(player.leftLeg.x+player.leftLeg.x2)/2,(player.leftLeg.y+player.leftLeg.y2)/2,0,2,2);
|
||||
break;
|
||||
case tutorialStates.placeOnGround:
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],500,-40,2,2);
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],430,-10,0,2,2);
|
||||
img(sprites.turn,560,-140,(~~(frameCount/10)%2) / 4,2,2);
|
||||
break;
|
||||
case tutorialStates.goDownStairs:
|
||||
img(sprites.tutArrow,360+~~(frameCount/10)%2,-30-~~(frameCount/10)%2,0,2,2);
|
||||
|
@ -23,6 +23,16 @@ let soundAssetMap = {
|
||||
"inhale": "./assets/sounds/breathing/inhale.mp3",
|
||||
"exhale": "./assets/sounds/breathing/exhale.mp3",
|
||||
"cough": "./assets/sounds/cough.mp3",
|
||||
"dead": "./assets/sounds/dead.mp3",
|
||||
"click": "./assets/sounds/click.mp3",
|
||||
"hover": "./assets/sounds/hover.wav",
|
||||
"pickUp": "./assets/sounds/pickUp.wav",
|
||||
"selectLeg": "./assets/sounds/selectLeg.mp3",
|
||||
"crash": "./assets/sounds/crash.mp3",
|
||||
"crack": "./assets/sounds/crack.mp3",
|
||||
"clonk": "./assets/sounds/clonk.mp3",
|
||||
"beep1": "./assets/sounds/beep1.wav",
|
||||
"beep2": "./assets/sounds/beep2.wav",
|
||||
"backingtrack": "./assets/sounds/backingtrack.wav"
|
||||
}
|
||||
|
||||
@ -39,6 +49,16 @@ let soundAssets = {
|
||||
inhale: new SoundSnippet("inhale", audioAssetType.sfx),
|
||||
exhale: new SoundSnippet("exhale", audioAssetType.sfx),
|
||||
cough: new SoundSnippet("cough", audioAssetType.sfx),
|
||||
dead: new SoundSnippet("dead", audioAssetType.sfx),
|
||||
click: new SoundSnippet("click", audioAssetType.sfx),
|
||||
hover: new SoundSnippet("hover", audioAssetType.sfx),
|
||||
pickUp: new SoundSnippet("pickUp", audioAssetType.sfx),
|
||||
selectLeg: new SoundSnippet("selectLeg", audioAssetType.sfx),
|
||||
crash: new SoundSnippet("crash", audioAssetType.sfx),
|
||||
crack: new SoundSnippet("crack", audioAssetType.sfx),
|
||||
clonk: new SoundSnippet("clonk", audioAssetType.sfx),
|
||||
beep1: new SoundSnippet("beep1", audioAssetType.sfx),
|
||||
beep2: new SoundSnippet("beep2", audioAssetType.sfx),
|
||||
backingtrack: new SoundSnippet("backingtrack", audioAssetType.bgm)
|
||||
}
|
||||
|
||||
|
@ -1,87 +1,64 @@
|
||||
var titleScreenState = "main"
|
||||
var cursor = mousePos;
|
||||
var timer = 0;
|
||||
var firstFrame = true;
|
||||
|
||||
function handleTitleScreen() {
|
||||
|
||||
switch (titleScreenState) {
|
||||
|
||||
case ("main"):
|
||||
case "main":
|
||||
handleMainScreen();
|
||||
break;
|
||||
case ("credits"):
|
||||
case "credits":
|
||||
handleCredits();
|
||||
break;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
centerCameraOn(0,0)
|
||||
|
||||
|
||||
centerCameraOn(0, 0)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function handleMainScreen(){
|
||||
if(rectpoint({x:415, y:200, w: 300, h: 50}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
globalState = globalStates.levelTransition;
|
||||
timer = 0;
|
||||
|
||||
// Play the bgm
|
||||
soundAssets.backingtrack.playForever();
|
||||
function handleMainScreen() {
|
||||
var elemStyle = document.getElementById("credits").style;
|
||||
if(elemStyle.display === "block") {
|
||||
elemStyle.display = "none";
|
||||
}
|
||||
if (!firstFrame) {
|
||||
if (mousePress[0]) {
|
||||
if (rectpoint({ x: 400, y: 200, w: 300, h: 50 }, mousePos)) {
|
||||
soundAssets.click.play();
|
||||
globalState = globalStates.levelTransition;
|
||||
|
||||
if(timer > 20){
|
||||
if(rectpoint({x:415, y:550, w: 300, h: 50}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
titleScreenState = "credits"
|
||||
timer = 0;
|
||||
// Play the bgm
|
||||
soundAssets.backingtrack.playForever();
|
||||
}
|
||||
|
||||
if (rectpoint({ x: 400, y: 550, w: 300, h: 50 }, mousePos)) {
|
||||
soundAssets.click.play();
|
||||
titleScreenState = "credits"
|
||||
timer = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
timer++;
|
||||
firstFrame = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handleCredits(){
|
||||
//console.log(`X ${cursor.x}, Y ${cursor.y}`);
|
||||
if(timer > 20){
|
||||
if(rectpoint({x:395, y:550, w: 140, h: 50}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
titleScreenState = "main";
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
// Rsninja
|
||||
if(rectpoint({x:400, y:145, w: 340, h: 30}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
window.open('https://rsninja.dev/', '_blank');
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
// Silas
|
||||
if(rectpoint({x:420, y:227, w: 350, h: 31}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
window.open('https://exvacuum.dev', '_blank');
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
//Evan
|
||||
if(rectpoint({x:430, y:307, w: 360, h: 50}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
window.open('https://retrylife.ca/', '_blank');
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
// // William
|
||||
if(rectpoint({x:460, y:382, w: 420, h: 50}, {x:cursor.x, y:cursor.y}) && mouseDown[0]){
|
||||
window.open('https://wm-c.dev', '_blank');
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
}else{
|
||||
timer++;
|
||||
function handleCredits() {
|
||||
var elemStyle = document.getElementById("credits").style;
|
||||
if(elemStyle.display === "none") {
|
||||
elemStyle.display = "block";
|
||||
}
|
||||
elemStyle.left = canvases.cvs.offsetLeft + 220 + "px";
|
||||
elemStyle.top = canvases.cvs.offsetTop + 20 + "px";
|
||||
|
||||
|
||||
|
||||
|
||||
if (rectpoint({ x: 80, y: 550, w: 140, h: 50 }, mousePos) && mousePress[0]) {
|
||||
soundAssets.click.play();
|
||||
titleScreenState = "main";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -89,38 +66,25 @@ function handleCredits(){
|
||||
function drawTitleScreen() {
|
||||
|
||||
if (titleScreenState === "main") {
|
||||
text("GAME TITLE HERE", 50, 50, "green", 8, 1000);
|
||||
rect(415, 200, 300, 50, "green");
|
||||
text("Play!", 355, 185, "white", 5, 150);
|
||||
img(sprites.backGround, cw / 2, ch / 2);
|
||||
|
||||
rect(415, 550, 300, 50, "green");
|
||||
text("Credits", 325, 535, "white", 5, 150);
|
||||
text("MicroManaged Mike", 100, 70, "white", 6);
|
||||
// rect(415, 200, 300, 50, "green");
|
||||
img(sprites["buttonBig" + (rectpoint({ x: 400, y: 200, w: 300, h: 50 }, mousePos) ? "Hover" : "")], 400, 200, 0, 2, 2);
|
||||
text("Play!", 340, 185, "#403826", 5, 150);
|
||||
|
||||
// rect(415, 550, 300, 50, "green");
|
||||
img(sprites["buttonBig" + (rectpoint({ x: 400, y: 550, w: 300, h: 50 }, mousePos) ? "Hover" : "")], 400, 550, 0, 2, 2);
|
||||
text("Credits", 310, 535, "#403826", 5, 150);
|
||||
}
|
||||
|
||||
if (titleScreenState === "credits") {
|
||||
text("CREDITS", 250, 50, "green", 8, 300);
|
||||
img(sprites.backGround, cw / 2, ch / 2);
|
||||
|
||||
text("rsninja dev", 250, 130, "green", 5, 1000);
|
||||
|
||||
text("Silas Bartha", 250, 210, "green", 5, 1000);
|
||||
|
||||
text("Evan Pratten", 250, 290, "green", 5, 1000);
|
||||
|
||||
text("William Meathrel", 250, 370, "green", 5, 1000)
|
||||
|
||||
//text("Sally Lopez", 250, 320, "green", 5, 1000)
|
||||
|
||||
rect(395, 550, 140, 50, "green");
|
||||
text("Back", 345, 535, "white", 5, 150);
|
||||
|
||||
text("*Names are links to their pages", 705, 495, "green", 2, 100);
|
||||
img(sprites["buttonSmall" + (rectpoint({ x: 80, y: 550, w: 140, h: 50 }, mousePos) ? "Hover" : "")], 80, 550, 0, 2, 2);
|
||||
text("Back", 30, 535, "#403826", 5, 150);
|
||||
|
||||
text("*Names are links to their pages", 705, 495, "black", 2, 100);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -6,7 +6,7 @@ function handleTransition(){
|
||||
|
||||
// Calculates alpha until its zero
|
||||
if(currentAlpha > 0){
|
||||
currentAlpha -= .005;
|
||||
currentAlpha -= .01;
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ function drawLevelTransitionUI() {
|
||||
// draws background sprites
|
||||
drawWorldBlocks();
|
||||
imgIgnoreCutoff(sprites.epic,0,0);
|
||||
imgIgnoreCutoff(sprites.chandelier,770,-235,0,4,4);
|
||||
imgIgnoreCutoff(sprites.chandelier,770,-300,0,4,4);
|
||||
player.draw();
|
||||
|
||||
// sets alpha to calculated alpha for black
|
||||
@ -54,5 +54,4 @@ function drawLevelTransitionUI() {
|
||||
|
||||
// resets alpha for rest of drawing
|
||||
canvases.ctx.globalAlpha = 1;
|
||||
|
||||
}
|
||||
|
BIN
docs/assets/sounds/beep1.wav
Normal file
BIN
docs/assets/sounds/beep2.wav
Normal file
BIN
docs/assets/sounds/click.mp3
Normal file
BIN
docs/assets/sounds/clonk.mp3
Normal file
BIN
docs/assets/sounds/crack.mp3
Normal file
BIN
docs/assets/sounds/crash.mp3
Normal file
BIN
docs/assets/sounds/dead.mp3
Normal file
BIN
docs/assets/sounds/hover.wav
Normal file
BIN
docs/assets/sounds/pickUp.wav
Normal file
BIN
docs/assets/sounds/selectLeg.mp3
Normal file
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="icon" type="image/gif" href="assets/images/tempIcon.png"/>
|
||||
<title>error: title is undefined</title>
|
||||
<title>Micromanaged Mike</title>
|
||||
<meta charset="utf-8" />
|
||||
<style>
|
||||
html {
|
||||
@ -16,15 +16,35 @@
|
||||
border: 5px solid var(--theme-webpage-canvas_border);
|
||||
background-color: var(--theme-webpage-canvas_bg);
|
||||
}
|
||||
a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
color: rgb(190, 190, 190);
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="assets/css/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<canvas width="800" height="600" id="game"></canvas>
|
||||
<pre style="position: absolute;left: 0;bottom: 0;"> TODO REMOVE ME
|
||||
z: blink
|
||||
x: breath
|
||||
c: beat heart
|
||||
<pre style="position:absolute;font-family: PixelArial11;font-size: 32px;display:none;" id="credits">
|
||||
<u>Programming</u>
|
||||
<a href="https://rsninja.dev">rsninja dev</a>
|
||||
<a href="https://wm-c.dev">William Meathrel</a>
|
||||
<a href="https://retrylife.ca/">Evan Pratten</a>
|
||||
<a href="https://exvacuum.dev">Silas Bartha</a>
|
||||
<a href="https://www.youtube.com/channel/UC5TeGG-Ak6ouX5JdxZB-ESg">MarshMarlow</a>
|
||||
|
||||
<u>Art</u>
|
||||
Sally Lopez
|
||||
<a href="https://rsninja.dev">rsninja dev</a>
|
||||
|
||||
<u>Music</u>
|
||||
Matthew West
|
||||
|
||||
<u>Sounds</u>
|
||||
<a href="https://retrylife.ca/">Evan Pratten</a>
|
||||
</pre>
|
||||
|
||||
<!-- Graphics Library -->
|
||||
@ -52,11 +72,15 @@ c: beat heart
|
||||
|
||||
<script src="assets/js/playing/playing.js"></script>
|
||||
<script src="assets/js/playing/objective.js"></script>
|
||||
<script src="assets/js/playing/particles.js"></script>
|
||||
|
||||
<script src="assets/js/titleScreen/titleScreen.js"></script>
|
||||
<script src="assets/js/UI/ui.js"></script>
|
||||
<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>
|
||||
|