2
我目前正在用python/pydev創建一個遊戲!在python中創建遊戲!刪除一個對象?
我的問題是:我有用戶可以在屏幕上移動的精靈。當他與另一個精靈發生衝突時,我希望其他精靈消失而不再被使用,但是現在,當我碰撞對象時,我想拾起什麼都沒有發生。 我需要做什麼代碼?我想我把它放在高清更新但不能確定.. 下面是我想要拾取的對象類!
class CV(pygame.sprite.Sprite):
def __init__(self, screen, (posX, posY)):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("cv.png")
self.image = self.image.convert()
transColor = self.image.get_at((1,1))
self.image.set_colorkey(transColor)
self.rect = self.image.get_rect()