<commit_before>import cursor
from cursor import *
import pygame
from pygame.locals import *
import sys
import gui
import Play
import credit

def createCanvas() :
        pygame.init()
        canvas = pygame.display.set_mode((800,600))
        menu1(canvas)
        return


def menu1(canvas):

        startButton = pygame.image.load("buttons/start.png").convert_alpha()
        leftArrow = pygame.image.load("buttons/larrow.png").convert_alpha()
        rightArrow = pygame.image.load("buttons/rarrow.png").convert_alpha()
        creditButton = pygame.image.load("buttons/credits.png").convert_alpha()
        closeButton = pygame.image.load("buttons/Exit.png").convert_alpha()
        
        helloWorld = pygame.image.load("VR.png").convert_alpha()
        robot = pygame.image.load("robot.png").convert_alpha()
        robot = pygame.transform.scale(robot,(300,300))

        robot = pygame.transform.scale(robot,(200,200))

        bg = pygame.image.load("wallpaper.jpg")

        soundDisabled = pygame.image.load("buttons/soundoff.png").convert_alpha()
        soundDisabled = pygame.transform.scale(soundDisabled,(35,50))
        soundEnabled = pygame.image.load("buttons/soundon.png").convert_alpha()
        soundEnabled = pygame.transform.scale(soundEnabled,(60,50))

        leftX = 10
        leftY = 300
        rightX = 100
        rightY = 300
        sX = 720
        sY = 540
        rX = 75
        rY = 200
        
        cX = 390
        cY = 400
        startX = 450
        startY = 300
        eX = 500
        eY = 500

        canvas.fill((0,0,0))
        canvas.blit(bg, (0,0))
        canvas.blit(leftArrow, (leftX,leftY))
        canvas.blit(rightArrow, (rightY,rightY))
        canvas.blit(soundDisabled,(sX,sY))
        canvas.blit(robot,(rX,rY))
        canvas.blit(creditButton,(cX,cY))
        canvas.blit(helloWorld,(0,0))
        canvas.blit(startButton,(startX,startY))
        canvas.blit(closeButton,(eX,eY))


        r = startButton.get_rect()
        #print (r.width,r.height,r.x)

        sound = 0

        while True:
                for event in pygame.event.get():
                        if event.type == QUIT:
                                pygame.quit()
                                sys.exit()
                        if event.type == KEYDOWN :
                            if event.key == K_ESCAPE :
                                pygame.quit()
                                sys.exit()
                        pos = pygame.mouse.get_pos()
                        if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1 :                        
                            if collide(startX,startY,startButton,pos) == 1 :
                                pygame.mouse.set_cursor(*cursor.ARROW_CURSOR)    
                                #gui.start(canvas)
                                Play.playMenu(canvas)
                                
                            elif collide(eX,eY,closeButton,pos) :
                                pygame.quit()
                                sys.exit()
                                    
                            elif sound == 0 and collide(sX,sY,soundDisabled,pos) == 1 :
                                sound = 1
                                canvas.blit(bg, (0,0))
                                canvas.blit(leftArrow, (leftX,leftY))
                                canvas.blit(rightArrow, (rightY,rightY))
                                canvas.blit(soundDisabled,(sX,sY))
                                canvas.blit(soundEnabled,(sX,sY))
                                canvas.blit(robot,(rX,rY))
                                canvas.blit(creditButton,(cX,cY))
                                canvas.blit(helloWorld,(0,0))
                                canvas.blit(startButton,(startX,startY))
                                canvas.blit(closeButton,(eX,eY))
                                break<commit_msg>The game starts when you click Start(not the play menu)<commit_after>import cursor
from cursor import *
import pygame
from pygame.locals import *
import sys
import gui
import Play
import credit

def createCanvas() :
        pygame.init()
        canvas = pygame.display.set_mode((800,600))
        menu1(canvas)
        return


def menu1(canvas):

        startButton = pygame.image.load("buttons/start.png").convert_alpha()
        leftArrow = pygame.image.load("buttons/larrow.png").convert_alpha()
        rightArrow = pygame.image.load("buttons/rarrow.png").convert_alpha()
        creditButton = pygame.image.load("buttons/credits.png").convert_alpha()
        closeButton = pygame.image.load("buttons/Exit.png").convert_alpha()
        
        helloWorld = pygame.image.load("VR.png").convert_alpha()
        robot = pygame.image.load("robot.png").convert_alpha()
        robot = pygame.transform.scale(robot,(300,300))

        robot = pygame.transform.scale(robot,(200,200))

        bg = pygame.image.load("wallpaper.jpg")

        soundDisabled = pygame.image.load("buttons/soundoff.png").convert_alpha()
        soundDisabled = pygame.transform.scale(soundDisabled,(35,50))
        soundEnabled = pygame.image.load("buttons/soundon.png").convert_alpha()
        soundEnabled = pygame.transform.scale(soundEnabled,(60,50))

        leftX = 10
        leftY = 300
        rightX = 100
        rightY = 300
        sX = 720
        sY = 540
        rX = 75
        rY = 200
        
        cX = 390
        cY = 400
        startX = 450
        startY = 300
        eX = 500
        eY = 500

        canvas.fill((0,0,0))
        canvas.blit(bg, (0,0))
        canvas.blit(leftArrow, (leftX,leftY))
        canvas.blit(rightArrow, (rightY,rightY))
        canvas.blit(soundDisabled,(sX,sY))
        canvas.blit(robot,(rX,rY))
        canvas.blit(creditButton,(cX,cY))
        canvas.blit(helloWorld,(0,0))
        canvas.blit(startButton,(startX,startY))
        canvas.blit(closeButton,(eX,eY))


        r = startButton.get_rect()
        #print (r.width,r.height,r.x)

        sound = 0

        while True:
                for event in pygame.event.get():
                        if event.type == QUIT:
                                pygame.quit()
                                sys.exit()
                        if event.type == KEYDOWN :
                            if event.key == K_ESCAPE :
                                pygame.quit()
                                sys.exit()
                        pos = pygame.mouse.get_pos()
                        if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1 :                        
                            if collide(startX,startY,startButton,pos) == 1 :
                                pygame.mouse.set_cursor(*cursor.ARROW_CURSOR)    
                                gui.start(canvas)
                                #Play.playMenu(canvas)
                                
                            elif collide(eX,eY,closeButton,pos) :
                                pygame.quit()
                                sys.exit()
                                    
                            elif sound == 0 and collide(sX,sY,soundDisabled,pos) == 1 :
                                sound = 1
                                canvas.blit(bg, (0,0))
                                canvas.blit(leftArrow, (leftX,leftY))
                                canvas.blit(rightArrow, (rightY,rightY))
                                canvas.blit(soundDisabled,(sX,sY))
                                canvas.blit(soundEnabled,(sX,sY))
                                canvas.blit(robot,(rX,rY))
                                canvas.blit(creditButton,(cX,cY))
                                canvas.blit(helloWorld,(0,0))
                                canvas.blit(startButton,(startX,startY))
                                canvas.blit(closeButton,(eX,eY))
                                break
{'fraction_non_alphanumeric': 0.10864072764022234, 'fraction_numerical': 0.021475492673067205, 'mean_word_length': 1.3135593220338984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3879932', 'n_tokens_mistral': 2382, 'n_tokens_neox': 2185, 'n_words': 330}