MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / objects

Method objects

projects/Space Shooter/main.py:135–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 self.text_list[0].selected = True
134
135 def objects(self):
136 # Background
137 Display().windows.blit(Display().background, (0, 0))
138 # Text
139 Display().windows.blit(
140 self.text(1),
141 ((Display().windows.get_width() - self.text(1).get_width()) / 2, 70),
142 )
143 Display().windows.blit(
144 self.text(2),
145 ((Display().windows.get_width() - self.text(2).get_width()) / 2, 200),
146 )
147 # Options
148 for text in self.text_list:
149 if text == self.text_list[0]:
150 ops = (
151 Display().windows.get_width() - text.display().get_width()
152 ) / 2 - 50
153 else:
154 ops = (
155 Display().windows.get_width() - text.display().get_width()
156 ) / 2 + 50
157
158 Display().windows.blit(text.display(), (ops, 250))
159
160 def controls(self, event: pygame.event):
161 if event.type == pygame.KEYDOWN:

Callers 1

executeMethod · 0.95

Calls 3

textMethod · 0.95
DisplayClass · 0.70
displayMethod · 0.45

Tested by

no test coverage detected