NSI - Loïs
scene =1
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 pk1
global pk2
global pk3
global pk4
global pk5
global pk6
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")
pk1= loadImage("pk1.jpg")
pk2= loadImage("pk2.jpg")
pk3= loadImage("pk3.jpg")
pk4= loadImage("pk4.jpg")
pk5= loadImage("pk5.jpg")
pk6= loadImage("pk6.jpg")
f = createFont("Corbel", 20)
textFont(f)
frameRate(15)
def draw():
# Displays the image at its actual size at point (0,0)
#print(mouseX)
global scene
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<438:
if mouseY>374:
scene +=1
print(scene)
if scene ==3:
scene_3()
def accueil():
img.resize(1440,780)
image(img, 0,0)
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():
scene=3
fill(255)
rect(0,0,1440,780)
img3.resize(1440,780)
image(img3,0,0,1440,780)
textSize(80)
fill(0,0,0)
text("Choisissez vos pokemons",325,85)
pk1.resize(141,218)
image(pk1,100,200,141,218)
image(pk2,300,200,141,218)
image(pk3,500,200,141,218)
image(pk4,700,200,141,218)
image(pk5,900,200,141,218)
image(pk6,1100,200,141,218)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<239:
if mouseX>100:
if mouseY<418:
if mouseY>200:
print(coucou1)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<438:
if mouseX>299:
if mouseY<418:
if mouseY>200:
print(coucou2)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<640:
if mouseX>499:
if mouseY<418:
if mouseY>200:
print(coucou3)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<840:
if mouseX>699:
if mouseY<418:
if mouseY>200:
print(coucou4)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<1040:
if mouseX>901:
if mouseY<418:
if mouseY>200:
print(coucou5)
if (mousePressed == True):
if (mouseButton == LEFT):
if mouseX<1240:
if mouseX>1098:
if mouseY<418:
if mouseY>200:
print(coucou6)