xxxxxxxxxx
221
function menuEvents() {
background(menubg)
textFont(font2)
textSize(25)
textAlign(CENTER)
fill('#0a38e3')
// fill('#fc326d')
text('press',265, 308 )
text('[enter]',265, 328 )
text('to start',265, 348)
}
function introEvents() {
background(dot)
fr ++
if(fr === 94){
intro = false
s1 = true
}
}
function s1Events() {
background(s1bg)
dialogueinsert = s1dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s2Events() {
background(s2bg)
dialogueinsert = s2dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s3Events() {
background(s3bg)
textType(dialogueinsert[index], width / 2, height / 2)
dialogueinsert = s3dia
}
function s4Events() {
background(s4bg)
textType(dialogueinsert[index], width / 2, height / 2)
dialogueinsert = s4dia
}
function cleanroomgameEvents() {
background(cleanroombg)
//create room objects
for (let i = 0; i < objects.length; i++) {
objects[i].show();
}
//if objects are gone = win
if (objects.length === 0) {
cleanroomgame = false
s5 = true
}
}
function s5Events() {
background(cleanroombg)
dialogueinsert = s5dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s6Events() {
background(s6bg)
dialogueinsert = s6dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s7Events() {
background(s7bg)
textType(dialogueinsert[index], width / 2, height / 2)
dialogueinsert = s7dia
}
function bowlgameEvents() {
background(bowlgamebg)
fr ++
//create ants
for (let i = 0; i < ants.length; i++) {
ants[i].show();
ants[i].move()
}
// if ants moved offscreen = win
let cnt = 0
for (let i = 0; i < ants.length; i++) {
if (ants[i].x <= 0 || ants[i].y <= 0 || this.x >= 300 || this.y >= 300) {
cnt = cnt +1
if (cnt === ants.length){
bowlgame = false
s8 = true
}
if (fr> 600 ){
bowlgame = false
s8 = true
}
}
}
}
function s8Events() {
background(bowlgamebg)
dialogueinsert = s8dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s9Events() {
background(s9bg)
dialogueinsert = s9dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function mirrorgameEvents() {
background(mirrorgamebg, width/2, height/2)
push()
imageMode(CENTER)
image(dirt, width/2, height/2, d, d)
pop()
d1 =dist(mouseX, mouseY, width/2-50, height/2-50)
if(d1<50){
cleansound.play()
changeD()
}
if (d=== 0){
mirrorgame = false
s10 = true
}
}
function changeD(){
d = d-5
}
function s10Events() {
background(s10bg)
dialogueinsert = s10dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s11Events() {
background(dot)
fr ++
if(fr === 94){
s11 = false
s12 = true
}
}
function s12Events() {
background(s12bg)
dialogueinsert = s12dia
textType(dialogueinsert[index], width / 2, height / 2)
}
function s13Events() {
background(s13bg)
dialogueinsert = s13dia
textType(dialogueinsert[index], width / 2, height / 2)
}