MCPcopy Create free account
hub / github.com/marblexu/PythonPlantsVsZombies / setupBackground

Method setupBackground

source/state/level.py:32–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 1

startupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected