(self)
| 30 | f.close() |
| 31 | |
| 32 | def setupBackground(self): |
| 33 | img_index = self.map_data[c.BACKGROUND_TYPE] |
| 34 | self.background_type = img_index |
| 35 | self.background = tool.GFX[c.BACKGROUND_NAME][img_index] |
| 36 | self.bg_rect = self.background.get_rect() |
| 37 | |
| 38 | self.level = pg.Surface((self.bg_rect.w, self.bg_rect.h)).convert() |
| 39 | self.viewport = tool.SCREEN.get_rect(bottom=self.bg_rect.bottom) |
| 40 | self.viewport.x += c.BACKGROUND_OFFSET_X |
| 41 | |
| 42 | def setupGroups(self): |
| 43 | self.sun_group = pg.sprite.Group() |