示例#1
0
文件: stage.py 项目: sphoid/mm-demo
 def load_hazards(self):
     for obj in self.map.get_layer_by_name('hazards'):
         x, y, width, height = int(obj.x), int(obj.y), int(obj.width), int(
             obj.height)
         self.hazards[x, y] = Hazards.load(obj.type,
                                           Rect((x, y), (width, height)))
示例#2
0
文件: stage.py 项目: sphoid/mm-demo
 def load_ladders(self):
     for obj in self.map.get_layer_by_name('ladders'):
         x, y, width, height = int(obj.x), int(obj.y), int(obj.width), int(
             obj.height)
         self.ladders[x, y] = GameObject(Rect((x, y), (width, height)))
示例#3
0
文件: view.py 项目: sphoid/mm-demo
	def in_view(self, rect):
		vrect = Rect((self.offset.x, self.offset.y), (self.size[0], self.size[1]))
		return rect.colliderect(vrect)
示例#4
0
文件: gate.py 项目: sphoid/mm-demo
    def load_sprites(self):
        image_at = self.spritesheet.image_at

        self.image = image_at(Rect((85, 0), (16, 16)))

        self.fill_sprites()
示例#5
0
 def load_sprites(self):
     image_at = self.spritesheet.image_at
     self.pellet_image = image_at(Rect((3, 2), (8, 6)), colorkey=-1)
示例#6
0
 def get_rect(self):
     return Rect((self.get_left(), self.get_top()),
                 (self.get_width(), self.get_height()))