click the top button for light and the bottom button to stop the bunny and duck from coming in (if they do you lose). click the posters and click & drag your mouse for a surprise! [Game: Five Nights at Freddy's]
A fork of FNAF game(kinda) by Jordyn
xxxxxxxxxx
//references for teaching somthing to myself
//https://processing.org/reference/noCursor_.html
//https://processing.org/reference/mouseDragged_.html
//image
PImage check;//floor
PImage fan;//fan
PImage leftwall;//left wall
PImage rightwall;//right wall
PImage leftdoor;//left door
PImage rightdoor;//right door
PImage leftwallback;//gray wall left
PImage rightwallback;//gray wall back
PImage backback;// back wall
PImage duck;//duck
PImage bunny;//bunny
Audio jumpscare;//jamp scare
boolean showleft = false;//left door
boolean showright = false;//right door
//boolean bbl = false; //idk what this is
boolean bun = false;//bunny "jumpscare"
boolean dukc = false;//duck "jumpscare"
int bunnyX = 600;//bunnys X spot
int duckX = 200;//ducks X spot
int red = 0;//you lose
int wow = 0;//reset
int uwu = 255;//left blackwall
int owo = 255;//right blackwall
int bigposter = 0;//big poster pop up
int smallposter = 0;//small poster pop up #1
int abc = 0;//small poster pop up #2
int cba =0;//small poster pop up #3
int uwo =0;// small poster pop up #4
int last =0;// small poster pop up #5
void setup() {//void setup
size (800,400);//size of area
background(0);//background color
check = loadImage ("tile.png");//floor
fan = loadImage ("fan.png");//fan
leftwall = loadImage ("leftwall.png");//leftwall
rightwall = loadImage ("rightwall.png");//rightwall
leftdoor = loadImage ("leftdoor.png");//leftdoor
rightdoor = loadImage ("rightdoor.png");//rightdoor
leftwallback = loadImage ("leftwallback.png");//gray left wall
rightwallback = loadImage ("rightwallback.png");//gray tight wall
backback = loadImage ("backback.png");//backwall
duck = loadImage ("duck.png");//duck
bunny = loadImage ("bunny.png");//bunny
jumpscare = new Audio ("jumpsccare.m4a");//jump scare
}
void draw(){//void draw
background(168,215,250);//background color (the one that shows but dont tell that to the background in void setup)
//floor tile
image (check,-180,300);
//left wall back
image (leftwallback,0,0,800,405);
//bonnie
stroke(0);
fill(164,79,188);
ellipse(bunnyX+25,220,20,20);//tail
rect(bunnyX,180,20,50);//body
ellipse(bunnyX+10,165,30,30);//face
ellipse(bunnyX,140,10,30);//left ear
ellipse(bunnyX+20,140,10,30);//right ear
fill(255);
ellipse(bunnyX+5,160,10,20);//left eye
ellipse(bunnyX+20,160,10,20);//right eye
fill(0);
ellipse(bunnyX+5,160,5,10);//left eye small
ellipse(bunnyX+20,160,5,10);//right eye small
//left wall
image (leftwall,0,0,810,405);
//right wall back
image(rightwallback,0,0,800,405);
//duck
fill(234,247,36);
rect(duckX,180,20,50);//body
fill(234,247,36);
ellipse(duckX+10,165,30,30);//face
fill(255);
ellipse(duckX+5,160,10,20);//left eye
ellipse(duckX+20,160,10,20);//right eye
fill(0);
ellipse(duckX+5,160,5,10);//left eye small
ellipse(duckX+20,160,5,10);//right eye small
fill(247,142,36);
ellipse(duckX+15,170,15,5);//mouth
ellipse(duckX+5,230,15,5);//left foot
ellipse(duckX+20,230,15,5);//right foot
//right blackwall
fill(0,0,0,owo);
beginShape();
vertex(600,0);
vertex(600,300);
vertex(800,400);
vertex(800,0);
endShape();
//black wall left
fill(0,0,0,uwu)
beginShape();
vertex(0,0);
vertex(200,0);
vertex(200,300);
vertex(0,400);
endShape();
//left wall
image (leftwall,0,0,810,405);
//rightwall
image (rightwall,0,0,800,405);
//backwall
image (backback,0,0,800,405);
// you lose
stroke(0);
fill(255,0,0,red);
textSize(50);
text("You Lose",300,350);
//reset
fill(255,255,255,wow);
stroke(0,0,0,wow);
rect(125,50,65,30);
fill(0,0,0,wow);
textSize(20);
text("Reset",130,70);
//behind left box
stroke(0);
fill(50);
rect(125,255,30,60);
//left box top
stroke(0);
fill(255);
rect(130,260,20,20);
//left box low
stroke(0);
fill(255);
rect(130,290,20,20);
//right box back
stroke(0);
fill(50);
rect(645,255,30,60);
//right box top
fill(255);
rect(650,260,20,20);
//right box low
fill(255);
rect(650,290,20,20);
//big poster
fill(255,255,255,bigposter);
textSize(25);
text("Get Back To Playing The Game Before You Lose",125,255);
//small poster #1
fill(48,95,244,smallposter);
textSize(25);
text("I'm a magical princess from another dimension",150,300);
//small poster #2
fill(0,0,0,abc);
textSize(25);
text("Hidden Potato",300,300);
//small poster #3
fill(0,0,0,cba);
textSize(25);
text("We'll Meet Again...",300,300);
//small poster #4
fill(0,0,0,uwo);
textSize(25);
text("A platypus? Parry The platypus!",225,300);
//small poster #5
fill(0,0,0,last);
textSize(25);
text("one of the first things I made :'D",225,300);
//show left door
if (showleft == true)
{
image(leftdoor,0,0);
bunnyX = bunnyX+1;
}
if (showleft == false)
{
bunnyX = bunnyX -0.5;
}
//show right door
if (showright == true)
{
image(rightdoor,0,0);
duckX = duckX-1;
}
if (showright == false)
{
duckX = duckX+0.5;
}
//duck jump
if (duckX >= 770)
{
dukc = true;
}
//duck jump scare sound
if (duckX >=770 && duckX <=775)
{
jumpscare.play();
}
//bunny jump
if (bunnyX <= 30)
{
bun = true;
}
//bunny sound jump scare
if(bunnyX <=30 && bunnyX >=25)
{
jumpscare.play();
}
//you lose bunny
if (bun == true)
{
image (bunny,0,0,800,405);
red = 225;
dukc = false;
wow = 255;
}
//you lose duck
if (dukc == true)
{
image (duck,0,0,800,405);
red = 225;
bun = false;
wow = 255;
}
}
void mousePressed() {//mouse clicked
//mouse
noCursor();
//show left door
if(mouseX > 130 && mouseX < 150 && mouseY > 290 && mouseY < 310)
{
showleft = true;
}
//show right door
if (mouseX > 650 && mouseX < 670 && mouseY > 290 && mouseY < 310)
{
showright = true;
}
//reset
if (mouseX > 125 && mouseX < 175 && mouseY > 50 && mouseY < 80)
{
bun = false;
dukc = false;
bunnyX = 600;
duckX = 200;
red = 0;
wow = 0;
}
//left blackout
if (mouseX > 130 && mouseX < 150 && mouseY > 260 && mouseY < 280)
{
uwu = 0;
}
//right blackout
if (mouseX > 650 && mouseX < 670 && mouseY > 260 && mouseY < 280)
{
owo = 0;
}
//big poster pop up
if (mouseX > 230 && mouseX < 380 && mouseY > 20 && mouseY < 220)
{
bigposter = 255;
}
//small poster #1
else if (mouseX > 440 && mouseX < 490 && mouseY > 30 && mouseY < 100)
{
smallposter = 255;
}
//small poster #2
else if (mouseX > 400 && mouseX < 450 && mouseY > 80 && mouseY < 150)
{
abc = 255;
}
//small poster #3
else if (mouseX > 530 && mouseX < 580 && mouseY > 10 && mouseY < 80)
{
cba = 255;
}
//small poster #4
else if (mouseX > 500 && mouseX < 550 && mouseY > 70 && mouseY < 140)
{
uwo = 255;
}
//small poster #5
else if (mouseX > 470 && mouseX < 520 && mouseY > 130 && mouseY < 200)
{
last = 255;
}
}
void mouseReleased(){
//no mouse
cursor();
//no show left door
showleft = false;
//noshow right door
showright = false;
//no show left balck box
uwu = 255;
//no show right black box
owo = 255;
//no show big poster
bigposter = 0;
//no show small poster #1
smallposter = 0;
//no show poster #2
abc = 0;
//no show poster #3
cba = 0;
//no show poster #4
uwo = 0;
//no show poster #5
last = 0;
}
void mouseDragged(){
//if mouse is dragged show light from doors
owo = owo-5;
uwu = uwu-5;
}