<commit_before>'''
Final Project
'''
from collections import Counter
from math import floor
from ggame import App, Color, LineStyle, Sprite, RectangleAsset
from ggame import CircleAsset, EllipseAsset, PolygonAsset, ImageAsset, MouseEvent, Frame

red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
black = Color(0x000000, 1.0)
white=Color(0xffffff,1.0)
yellow=Color(0xffff00,1.0)

thinline = LineStyle(1, black)
noline=LineStyle(0,white)



class pacman(Sprite):
    pacmanSprite=CircleAsset(10,noline,yellow)
    #pacman=RectangleAsset(20,10,noline,yellow)
    def __init__(self,position):
        super().__init__(pacman.pacmanSprite,position)
        self.position=position
        self.vx=0
        self.vy=0
        self.vr=0
        self.moving=0
        self.movingframe=1
        
        '''
        When keys are pressed
        '''
        
        pacmanGame.listenKeyEvent("keydown","right arrow", self.rightmoving)
        pacmanGame.listenKeyEvent("keydown","left arrow",self.leftmoving)
        pacmanGame.listenKeyEvent("keydown","down arrow",self.downmoving)
        pacmanGame.listenKeyEvent("keydown","up arrow",self.upmoving)
        '''
        When keys are released
        '''

    '''
    When keys are pressed they do these things
    '''
    
    def rightmoving(self,event):
            self.vx=1
            self.vy=0
            
    def leftmoving(self,event):
            self.vx=-1
            self.vy=0
            
    def downmoving(self,event):
            self.vy=1
            self.vx=0
            
    def upmoving(self,event):
            self.vy=-1
            self.vx=0
            
    '''
    When keys are released they do these things
    '''
    
    def step(self):
        self.x+=self.vx
        self.y+=self.vy
        self.rotation+=self.vr
    
    #def collision(self,position):
     #   if position==(200,y):
      #      rightmoving.vx=0
       #     leftmoving.vx=0
        #    downmoving.vy=0
         #   upmoving.vy=0

class ghost(pacman):
    ghostRed=RectangleAsset(20,10,noline,red)
    def __init__(self,position):
        super().__init__(ghost.ghostRed,position)
        #self.position=position
        #self.vx=0
        #self.vy=0
        #self.vr=0
        #self.moving=0
        #self.movingframe=1
        
        
        
        
        
class pacmanGame(App):
    def __init__(self,width,height):
        super().__init__(width,height)
        background=RectangleAsset(width, height, noline, black)
        bg=Sprite(background, (0,0))
        
    def step(self):
        for pman in self.getSpritesbyClass(pacman):
            pman.step()
        
        for rghost in self.getSpritesbyClass(ghost):
            rghost.step()
        
        
class maze():
    def __init__(self):
        pass #Will put stuff here later
    
    def open(x,y):
        return True
        
        
class OtherSprites(Sprite):
    def __init__(self):
        wall=RectangleAsset(10,200,noline,black)<commit_msg>Updated from Brython Server: 12/30/2016 3:26:55 PM<commit_after>'''
Final Project
'''
from collections import Counter
from math import floor
from ggame import App, Color, LineStyle, Sprite, RectangleAsset
from ggame import CircleAsset, EllipseAsset, PolygonAsset, ImageAsset, MouseEvent, Frame

red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
black = Color(0x000000, 1.0)
white=Color(0xffffff,1.0)
yellow=Color(0xffff00,1.0)

thinline = LineStyle(1, black)
noline=LineStyle(0,white)



class pacman(Sprite):
    pacmanSprite=CircleAsset(10,noline,yellow)
    #pacman=RectangleAsset(20,10,noline,yellow)
    def __init__(self,position):
        super().__init__(pacman.pacmanSprite,position)
        self.position=position
        self.vx=0
        self.vy=0
        self.vr=0
        self.moving=0
        self.movingframe=1
        
        '''
        When keys are pressed
        '''
        
        pacmanGame.listenKeyEvent("keydown","right arrow", self.rightmoving)
        pacmanGame.listenKeyEvent("keydown","left arrow",self.leftmoving)
        pacmanGame.listenKeyEvent("keydown","down arrow",self.downmoving)
        pacmanGame.listenKeyEvent("keydown","up arrow",self.upmoving)
        '''
        When keys are released
        '''

    '''
    When keys are pressed they do these things
    '''
    
    def rightmoving(self,event):
            self.vx=1
            self.vy=0
            
    def leftmoving(self,event):
            self.vx=-1
            self.vy=0
            
    def downmoving(self,event):
            self.vy=1
            self.vx=0
            
    def upmoving(self,event):
            self.vy=-1
            self.vx=0
            
    '''
    When keys are released they do these things
    '''
    
    def step(self):
        self.x+=self.vx
        self.y+=self.vy
        self.rotation+=self.vr
    
    #def collision(self,position):
     #   if position==(200,y):
      #      rightmoving.vx=0
       #     leftmoving.vx=0
        #    downmoving.vy=0
         #   upmoving.vy=0

class ghost(Sprite):
    ghostRed=RectangleAsset(20,10,noline,red)
    def __init__(self,position):
        super().__init__(ghost.ghostRed,position)
        self.position=position
        self.vx=0
        self.vy=0
        self.vr=0
        self.moving=0
        self.movingframe=1
        
        
        
        
        
class pacmanGame(App):
    def __init__(self,width,height):
        super().__init__(width,height)
        background=RectangleAsset(width, height, noline, black)
        bg=Sprite(background, (0,0))
        
    def step(self):
        for pman in self.getSpritesbyClass(pacman):
            pman.step()
        
        for rghost in self.getSpritesbyClass(ghost):
            rghost.step()
        
        
class maze():
    def __init__(self):
        pass #Will put stuff here later
    
    def open(x,y):
        return True
        
        
class OtherSprites(Sprite):
    def __init__(self):
        wall=RectangleAsset(10,200,noline,black)
{'fraction_non_alphanumeric': 0.1101483086152308, 'fraction_numerical': 0.027162139643392768, 'mean_word_length': 2.0544529262086515, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '602958', 'n_tokens_mistral': 2008, 'n_tokens_neox': 1877, 'n_words': 349}