top of page


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 joueur
    global lock1
    lock1=False
    global lock2
    lock2=False
    global lock3
    lock3=False
    global lock4
    lock4=False
    global lock5
    lock5=False
    global lock6
    lock6=False
    
    joueur = 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(65)
    

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():
    
    img3.resize(1440,780)
    image(img3,0,0)
    textSize(80)
    fill(0,0,0)
    text("Choisissez vos pokemons",325,85)
    image(pkf,150,200)
    if (mousePressed == True):
            if(mouseButton == LEFT):
                if (joueur == 0):
                    if mouseX<239:
                        if mouseX>100:
                            if mouseY<418:
                                if mouseY>200:
                                    if (lock1==False):
                                        fill(0,0,204,127)
                                        rect(100,200,141,218)
                                        joueur=1
                                        lock1=True
                    if mouseX<438:
                        if mouseX>299:
                            if mouseY<418:
                                if mouseY>200:
                                    if (lock2==False):
                                        fill(0,0,204,127)
                                        rect(299,200,141,218)
                                        lock2=True
                    if mouseX<640:
                        if mouseX>499:
                            if mouseY<418:
                                if mouseY>200:
                                    if(lock3==False):
                                        fill(0,0,204,127)
                                        rect(499,200,141,218)
                                        lock3=True
                                    
    
    
                    if mouseX<840:
                        if mouseX>699:
                            if mouseY<418:
                                if mouseY>200:
                                    if(lock4==False):
                                        fill(0,0,204,127)
                                        rect(699,200,141,218)
                                        lock4=True
                                

                    if mouseX<1040:
                        if mouseX>901:
                            if mouseY<418:
                                if mouseY>200:
                                    if(lock5==False):
                                        fill(0,0,204,127)
                                        rect(901,200,141,218)
                                        lock5=True
                            
                                
                    if mouseX<1240:
                        if mouseX>1098:
                            if mouseY<418:
                                if mouseY>200:
                                    if(lock6==False):
                                        fill(0,0,204,127)
                                        rect(1098,200,141,218)
                                        lock6=True
 

NSI

Leplusbeausite

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

bottom of page