code processing du 09/02/2024
Donc là c'est le code tout pourris qui marche pas (on se demande qui l'a fait):
scene =1
def setup():
size(1080, 600)
global img
global img1
global img2
global imgparch
global img3
img = loadImage("pyramide.jpg")
img1 = loadImage("salon_anglais.jpg")
img2 = loadImage("intérieur_1.jpg")
imgparch = loadImage("el_parchemin.jpg")
img3 = loadImage("fin.jpg")
printArray(PFont.list())
f = createFont("Corbel", 20)
textFont(f)
frameRate(7)
def draw():
global scene
if scene==1:
scene_1()
if scene==2:
parchemin_1()
if scene==3:
scene_2()
if scene==4:
scene_3()
if scene==5:
scene_4()
if mouseX<1000:
if mouseX>950:
if mouseY<550:
if mouseY>500:
fill(250,100,89)
rect(950,500,50,50)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<1000:
if mouseX>950:
if mouseY<550:
if mouseY>500:
scene +=1
print (scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<270:
if mouseX>250:
if mouseY<110:
if mouseY>90:
scene +=1
print(scene)
else:
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<310:
if mouseX>290:
if mouseY<110:
if mouseY>90:
scene +=2
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<1000:
if mouseX>950:
if mouseY<550:
if mouseY>500:
scene +=1
print(scene)
def scene_1():
image(img, 100,-450)
fill(255)
rect(800,1000,50,50)
fill(225,0,0)
textSize(36)
text("Bienvenue etranger",250,50)
textSize(14)
text("Vous etes actuellement un(e) archeologue renomme(e) et vous vous trouvez sur un chantier en Egypte...",250,70)
fill(248,156,89)
rect(950,500,50,50)
def scene_2():
image(img1,0,0)
fill(225)
rect(474,372,50,50)
def scene_3():
image(img2,0,0)
fill(225)
rect(474,372,50,50)
fill(248,156,89)
rect(950,500,50,50)
def scene_4():
image(img3,0,0)
fill(225)
rect(474,372,50,50)
def parchemin_1():
image(imgparch, 100,-450)
fill(255)
rect(250,100,50,50)
fill(225,0,0)
textSize(14)
text("Vous decidez entrer dans la pyramide choix 1/ Vous decider de retourner chez vous ni vu ni connu choix 2",250,70)
fill(225,225,225)
rect(250,90,20,20)
fill(225,0,0)
rect(290,90,20,20)
blablabla...
code processing du 08/03/2024
Et là c'est un jolie code qui fonctionne
scene =1
sac =0
massemax=30
info=0
def setup():
size(1080, 566)
global img
global img2
global img3
global img4
global img5
global img6
global img7
global img8
global img9
img = loadImage("pyramide.jpg")
img2 = loadImage("elparchemin.jpg")
img3= loadImage("salon_anglais.jpg")
img4= loadImage("interieur_1.jpg")
img5= loadImage("fin.jpg")
img6= loadImage("objet_1.jpg")
img7= loadImage("interieur2.jpg")
img8= loadImage("interieur3.jpg")
img9= loadImage("objet_2.jpg")
printArray(PFont.list())
f = createFont("Corbel", 20)
textFont(f)
frameRate(7)
def draw():
global scene
global sac
global massemax
global info
if scene==1:
premiere_scene()
if scene ==2:
seconde_scene()
if scene ==3:
troisieme_scene()
if scene ==4:
quatrieme_scene()
if info==1:
scene_info_1()
if sac ==1:
quatrieme_scene()
if scene ==5:
cinquieme_scene()
if scene ==6:
sixieme_scene()
if scene ==7:
if sac==0:
cinquieme_scene()
if sac==1:
septieme_scene()
if mouseX<1000:
if mouseX>950:
if mouseY<550:
if mouseY>500:
fill(250,100,89)
rect(950,500,50,50)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<1000:
if mouseX>950:
if mouseY<550:
if mouseY>500:
scene +=1
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<445:
if mouseX>425:
if mouseY<220:
if mouseY>200:
scene +=1
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<620:
if mouseX>600:
if mouseY<220:
if mouseY>200:
scene +=2
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<250:
if mouseX>200:
if mouseY<550:
if mouseY>500:
scene +=2
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<50:
if mouseX>0:
if mouseY<550:
if mouseY>500:
scene +=2
print(scene)
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<354:
if mouseX>299:
if mouseY<239:
if mouseY>199:
info+=1
if (mousePressed == True):
if (mouseButton == RIGHT):
if mouseX<450:
if mouseX>400:
if mouseY<290:
if mouseY>240:
sac+=1
def premiere_scene():
image(img, 100,-450)
fill(255)
rect(800,1000,50,50)
fill(225,0,0)
textSize(36)
text("Bienvenue etranger",250,50)
textSize(14)
text("Vous etes actuellement un(e) archeologue renomme(e) et vous vous trouvez sur un chantier en Egypte...",250,70)
fill(248,156,89)
rect(950,500,50,50)
def seconde_scene():
image(img2, 300,0)
fill(255)
fill(25,56,89)
textSize(14)
text("Vous decidez entrer dans la pyramide choix rouge ",350,70)
text("Vous decider de retourner chez vous ni vu ni connu choix gris",350,90)
fill(225,225,225)
rect(425,200,20,20)
fill(225,0,0)
rect(600,200,20,20)
def troisieme_scene():
fill(0,0,0)
rect(0,0,2000,1000)
image(img3,160,20)
fill(225,225,225)
rect(200,500,50,50)
image(img2,0,-480)
fill(250,0,0)
textSize(14)
text("Vous avez donc decide de retourner chez vous ni vu ni connu ",20,70)
text("Vous cous detandez donc dans votre salon de riche et car vous",20,90)
text("acez soif vous cous faite un coffi et comme en faite c'est moi",20,110)
text("qui decide ici vous y mettait un scucre et vous vous etouffez.",20,130)
def quatrieme_scene():
image(img4,-200,-20)
fill(225,225,225)
rect(200,500,50,50)
fill(225,225,225)
rect(299,199,55,40)
image(img6,300,200)
def scene_info_1():
fill(225,225,225)
fill(225,225,225)
rect(299,199,55,40)
image(img6,300,200)
fill(225,0,0)
textSize(20)
text("Voici une tres belle pierre. Vous ete archeologue donc vous savez que c'est une gemme,",350,70)
text("Et si vous dites que ce n'est pas une gemme parce que MONSIEUR ou MADAME si ",350,90)
text("connait en pierre,je lui dis c'est mon jeu c'est moi qui decide...",350,110)
text("infos : gemme",400,130)
text("valeur : 30",420,150)
text("poids : 0",420,170)
text("prendre gemme boutton rouge et cliquer une fois!!!",420,190)
fill(225,0,0)
rect(400,240,50,50)
def cinquieme_scene():
fill(0,0,0)
rect(0,0,2000,1000)
image(img5,300,0)
fill(250,0,0)
textSize(50)
text("Dammage",100,70)
def sixieme_scene():
fill(0,0,0)
rect(0,0,2000,1000)
image(img7,0,-100)
fill(248,156,89)
rect(950,500,50,50)
image(img2,330,-500)
fill(225,0,0)
textSize(20)
text("Il semblerait qu'un fois rentre une porte se soit",350,50)
text("refermee derriere vous.Vous ete arriver decant ",350,70)
text("une porte qui dans son centre contient un truc ",350,90)
text("pour deposer une gemme qu'elle chance que vous ",350,110)
text(" l'ayait rammasee... ",350,130)
def septieme_scene():
fill(0,0,0)
rect(0,0,2000,1000)
image(img8,50,-100)