Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- spriteOffset = 10
- boxWidth = 80
- #Set up the sprites for every peice
- class bPawn(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bPawn.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wPawn(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wPawn.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class bBishop(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bBishop.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wBishop(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wBishop.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class bKing(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bKing.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wKing(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wKing.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class bKnight(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bKnight.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wKnight(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wKnight.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class bQueen(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bQueen.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wQueen(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wQueen.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class bRook(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/bRook.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- class wRook(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("peices/wRook.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- self.moved = 0
- #The sprite for outlining tiles for debugging purposes
- class dbhighlight(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("otherSprites/dbhighlight.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- #The sprite for the outline that shows available moves of a selected peice
- class highlight(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("otherSprites/highlight.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- #The sprite for the outline that shows the currently selected piece
- class highlightCurr(pygame.sprite.Sprite):
- def __init__(self, x, y):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("otherSprites/highlightCurr.png")
- self.rect = self.image.get_rect()
- self.rect.x = x
- self.rect.y = y
- class checkmate(pygame.sprite.Sprite):
- def __init__(self):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load("otherSprites/checkmate.png")
- self.rect = self.image.get_rect()
- self.rect.x = boxWidth
- self.rect.y = 3*boxWidth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement