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()