xxxxxxxxxx
var sgif
var d1
var s2
var d2
var d3
var s3
var both
var s4
var s
//set images
function preload(){
sgif = loadImage('sgif.gif')
d1 = loadImage('d1.png')
s2 = loadImage('s2.gif')
d2 = loadImage('d2.gif')
s3 = loadImage('s3.gif')
d3 = loadImage('d3.webp')
both = loadImage('both.jpeg')
s4 = loadImage('s4.png')
s = loadImage('s.gif')
}//end preload
function setup() {
createCanvas(600, 600);
imageMode(CENTER)
image_number = 1
image_number = 2
image_number = 3
image_number = 4
image_number = 5
image_number = 6
image_number = 7
image_number = 8
image_number = 9
//music
marvel.play()
}
function draw() {
background(0);
if(image_number==1){
image(sgif,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Hi! I am your friendly neighborhood Spiderman!',100,100)
} //end of scene 1
if(image_number==2){
image(d1,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('... and I am Doctor Strange.',100,100)
} //end of scene 2
if(image_number==3){
image(s2,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Doc I need you to cast a spell for me.',100,100)
} //end of scene 3
if(image_number==4){
image(d2,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Of course you do. I guess I will help.')
} //end of scene 4
if(image_number==6){
image(d3,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Do not distract me.This is a complicated spell.')
}//end of scene 6
if(image_number==5){
image(s3,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Wait! That is not how I want it to go.')
} //end of scene 5
if(image_number==7){
image(both,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Ugh. I guess we both have to fix this now.')
} //end of scene 6
if(image_number==8){
image(s4,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('Oops!')
} //end of scene 7
if(image_number==9){
image(s,300,300,500,500)
//text
textSize(18)
fill(255)
stroke(0)
strokeWeight(3)
text('To be continued...')
}//end of story
}
function keyPressed(){
if(key=='1'){
image_number =1
} // end 1
if(key=='2'){
image_number =2
}//end 2
if(key=='3'){
image_number =3
}//end 3
if(key=='4'){
image_number =4
}//end 4
if(key=='5'){
image_number =5
}//end 5
if(key=='6'){
image_number =6
}//end 6
if(key=='7'){
image_number =7
}//end 7
if(key=='8'){
image_number =8
}//end 8
if(key=='9'){
image_number =9
}//end last
}//end keyPressed
function keyTyped(){
if(key==' '){
if(marvel.isPlaying())
marvel.stop ()}
else{
marvel.play()
}// end keyTyped
}