NSI - Loïs
#import processing.sound.*;
#SoundFile file;
lock1=0
lock2=0
lock3=0
lock4=0
lock5=0
lock6=0
joueur = 0
scene =1
eq1=[]
eq2=[]
pk1=("bulbizarre",1)
pk2=("dracofeu",2)
pk3=("tortank",3)
pk4=("pikachu",4)
pk5=("onigali",5)
pk6=("karaclee",6)
def setup():
size(1440, 780)
# The image file must be in the data folder of the current sketch
# to load successfully
global img
global img2
global img3
global img5
global pkf
img = loadImage("Scene_0.jpeg") # Load the image into the program
img2 = loadImage("Scene_1.jpg") # Load the image into the program
img3= loadImage("scene_3.jpg")
img5=loadImage("Scene_5.jpg")
pkf= loadImage("pkf.png")
f = createFont("Corbel", 20)
textFont(f)
frameRate(15)
def draw():
print("Y",mouseY,"X",mouseX,eq1,eq2)
#print("1:",lock1,"2:",lock2,"3:",lock3,"4:",lock4,"5:",lock5,"6:",lock6)
# Displays the image at its actual size at point (0,0)
global scene
global joueur
global lock1
global lock2
global lock3
global lock4
global lock5
global lock6
global eq1
global eq2
def lock_1():
lock1=1
fill(0,0,204,127)
rect(100,200,141,218)
if scene==1:
accueil()
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<750:
if mouseX>600:
if mouseY<650:
if mouseY>600:
scene +=1
print(scene)
if scene ==2:
scene_2()
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<914:
if mouseX>525:
if mouseY<540:
if mouseY>477:
scene =4
print(scene)
if mouseY<438:
if mouseY>374:
scene +=1
print(scene)
if scene ==3:
scene_3()
if joueur==0:
fill(255)
rect(0,0,1440,780)
img3.resize(1440,780)
image(img3,0,0)
image(pkf,150,200)
textSize(80)
fill(0,0,0)
text("J1,choisissez vos pokemons",325,85)
if joueur==1:
fill(255)
rect(0,0,1440,780)
img3.resize(1440,780)
image(img3,0,0)
image(pkf,150,200)
textSize(80)
fill(0,0,0)
text("J2,choisissez vos pokemons",325,85)
if len(eq1)==3 and len(eq2)==3:
scene =5
if lock1==1:
fill(0,0,204,127)
rect(150,200,141,218)
if lock2==1:
fill(0,0,204,127)
rect(339,200,141,218)
if lock3==1:
fill(0,0,204,127)
rect(529,200,141,218)
if lock4==1:
fill(0,0,204,127)
rect(719,200,141,218)
if lock5==1:
fill(0,0,204,127)
rect(899,200,141,218)
if lock6==1:
fill(0,0,204,127)
rect(1089,200,141,218)
#if (lock1==1):
# fill(0,0,204,127)
# rect(100,200,141,218)
#else:
#print(lock1)
#mousePressed=False
if (mousePressed == True):
if(mouseButton == LEFT):
print("salut")
if ((mouseY>418) or (mouseY<200)):
print("En dehors")
else:
print(mouseX)
if (joueur == 0):
print(joueur)
if ((mouseX<239) and (mouseX>100)):
if (lock1==0):
lock1=1
joueur=1
eq1.append(pk1)
elif mouseX<438 and mouseX>299:
if (lock2==0):
lock2=1
joueur=1
eq1.append(pk2)
elif mouseX<640 and mouseX>499:
if(lock3==0):
lock3=1
joueur=1
eq1.append(pk3)
elif mouseX<840 and mouseX>699:
print('ici')
if(lock4==0):
lock4=1
joueur=1
eq1.append(pk4)
elif mouseX<1040 and mouseX>901:
if(lock5==0):
lock5=1
joueur=1
eq1.append(pk5)
elif mouseX<1240 and mouseX>1098:
if(lock6==0):
lock6=1
joueur=1
eq1.append(pk6)
elif (joueur == 1):
if mouseX<239 and mouseX>100:
if (lock1==0):
lock1=1
joueur=0
eq2.append(pk1)
elif mouseX<438:
if mouseX>299:
if (lock2==0):
lock2=1
joueur=0
eq2.append(pk2)
elif mouseX<640 and mouseX>499:
if(lock3==0):
lock3=1
joueur=0
eq2.append(pk3)
elif mouseX<840 and mouseX>699:
if(lock4==0):
lock4=1
joueur=0
eq2.append(pk4)
elif mouseX<1040 and mouseX>901:
if(lock5==0):
lock5=1
joueur=0
eq2.append(pk5)
elif mouseX<1240 and mouseX>1098:
if(lock6==0):
lock6=1
joueur=0
eq2.append(pk6)
if scene==4:
scene_4()
if mousePressed==True:
if mouseButton==LEFT:
if mouseX>631 and mouseX<695:
print("salut")
if mouseY>1133 and mouseY<1185:
print("coucou")
scene=2
print(scene)
if scene==5:
scene_5()
def accueil():
img.resize(1440,780)
image(img, 0,0)
#file1.play()
noStroke();
fill(255,255,255,127)
rect(650,600,100,50);
textSize(25)
fill(0)
text("Jouer",665,630)
stroke(255,204,51);
fill(0,0,255)
textSize(100)
text("Pokemon : Trainer Contest",120,200);
def scene_2():
scene=2
fill(255)
rect(0,0,1440,780)
image(img2, 0,0,1440,780)
img2.resize(1440,780)
textSize(50)
fill(255, 255, 0)
text("Duel",665,423)
text("Options",635,520)
def scene_3():
fill(255)
rect(0,0,1440,780)
img3.resize(1440,780)
image(img3,0,0)
image(pkf,150,200)
def scene_4():
print(scene)
fill(70,130,180)
rect(250,150,950,550)
fill(70,130,200)
textSize(100)
text("Ouvrez la pokeball",370,250)
fill(255,255,0)
text("X",1130,695)
def scene_5():
fill(255)
rect(0,0,1440,780)
image(img5,0,0,1440,780)
img5.resize(1440,780)