Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created October 11, 2020 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/b66d601fd807c407ee5f26caca40dd58 to your computer and use it in GitHub Desktop.
Save JeffersGlass/b66d601fd807c407ee5f26caca40dd58 to your computer and use it in GitHub Desktop.
import pygame.sprite
class Treasure(pygame.sprite.Sprite):
def __init__(self, name, xLocation, yLocation, value=1):
self.name = name
self.value = value
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface([20,20])
self.image.fill((200,255,0))
self.rect = self.image.get_rect()
self.rect.x = xLocation
self.rect.y = yLocation
def getValue(self):
return self.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment