top of page

#import processing.sound.*;
#SoundFile file;


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 pkf
    global init
    init=0
    
    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") 
    pkf= loadImage("pkf.png")
    
    f = createFont("Corbel", 20)
    textFont(f)
    frameRate(15)
    

def draw():
       # Displays the image at its actual size at point (0,0)
    
    
    global scene
    global lock1
    lock1=0
    global lock2
    lock2=0
    global lock3
    lock3=0
    global lock4
    lock4=0
    global lock5
    lock5=0
    global lock6
    lock6=0
    global joueur
    joueur = 0
    
    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 (lock1==1):
          #  fill(0,0,204,127)
         #   rect(100,200,141,218)
        #else:
            #print(lock1)
            
        
        #mousePressed=False
        if (mousePressed == True):
            if(mouseButton == LEFT):
                 
                 if ((mouseY>418) or (mouseY<200)):
                    print("Coucou")
                 else:
                         print(mouseX)
                         if (joueur == 0):
                                print(joueur)
                                if ((mouseX<239) and (mouseX>100)):
                                        if (lock1==0):
                                             joueur=1
                                             lock1=1
                                             lock_1()
                                             print(lock1)
                                             
                                elif mouseX<438 and mouseX>299:
                                        if (lock2==0):
                                            fill(0,0,204,127)
                                            rect(299,200,141,218)
                                            joueur=1
                                            lock2=True
                                elif mouseX<640 and mouseX>499:                                        
                                            if(lock3==0):
                                                fill(0,0,204,127)
                                                rect(499,200,141,218)
                                                joueur=1
                                                lock3=True
                                elif mouseX<840 and mouseX>699: 
                                            print('ici')                                       
                                            if(lock4==0):
                                                fill(0,0,204,127)
                                                rect(699,200,141,218)
                                                joueur=1
                                                lock4=True
                                elif mouseX<1040 and mouseX>901:
                                            if(lock5==0):
                                                fill(0,0,204,127)
                                                rect(901,200,141,218)
                                                joueur=1
                                                lock5=True
                                elif mouseX<1240 and mouseX>1098:
                                            if(lock6==0):
                                                fill(0,0,204,127)
                                                rect(1098,200,141,218)
                                                joueur=1
                                                lock6=True
                            
                         elif (joueur == 1):
                                    if mouseX<239:
                                        if mouseX>100:
                                            if (lock1==0):
                                                fill(0,0,204,127)
                                                rect(100,200,141,218)
                                                joueur=0
                                                lock1=True
                                    if mouseX<438:
                                        if mouseX>299:
                                            if (lock2==0):
                                                fill(0,0,204,127)
                                                rect(299,200,141,218)
                                                joueur=0
                                                lock2=True
                                    if mouseX<640:
                                        if mouseX>499:
                                            if(lock3==0):
                                                fill(0,0,204,127)
                                                rect(499,200,141,218)
                                                joueur=0
                                                lock3=True
                                                
                
                
                                    if mouseX<840:
                                        if mouseX>699:
                                            if(lock4==0):
                                                fill(0,0,204,127)
                                                rect(699,200,141,218)
                                                joueur=0
                                                lock4=True
                                            
            
                                    if mouseX<1040:
                                        if mouseX>901:    
                                            if(lock5==0):
                                                fill(0,0,204,127)
                                                rect(901,200,141,218)
                                                joueur=0
                                                lock5=True
                                        
                                            
                                    if mouseX<1240:
                                        if mouseX>1098:
                                            if(lock6==0):
                                                fill(0,0,204,127)
                                                rect(1098,200,141,218)
                                                joueur=0
                                                lock6=True
    
    
    if scene==4:
        scene_4()
        
        
    


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)
    textSize(80)
    fill(0,0,0)
    text("Choisissez vos pokemons",325,85)
    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",1195,695)

NSI

Leplusbeausite

© 2023 par Loïs Guillerme. Créé avec Wix.com

bottom of page