You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
593 B

import pygame
class Item(pygame.sprite.Sprite):
def __init__(self,x,y,w,h,name):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface((w,h)).convert() # 添加一个空的图层使其各自有一个宽高
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
self.name = name
class Checkpoint(Item):
def __init__(self,x,y,w,h,checkpoint_type,enemy_groupid=None,name='checkpoint'):
Item.__init__(self,x,y,w,h,name)
self.checkpoint_type = checkpoint_type
self.enemy_groupid = enemy_groupid