예제 #1
0
파일: Planet.py 프로젝트: atheys/Portfolio
    def draw(self, screen, zoom_factor, offset_pos=(0, 0)):
        draw_pos = (self.pos[0] - offset_pos[0], self.pos[1] - offset_pos[1])
        draw(screen, self.sprite, draw_pos, self.angle, self.scale,
             zoom_factor)

        for s in self.satellites:
            s.draw(screen, zoom_factor, offset_pos)

        self.launcher.draw(screen, zoom_factor, offset_pos)
예제 #2
0
파일: Rocket.py 프로젝트: atheys/Portfolio
 def draw(self, screen, zoom_factor, offset_pos=(0, 0)):
     draw_pos = (self.pos[0] - offset_pos[0], self.pos[1] - offset_pos[1])
     if not self.exploded:
         if offset_pos == (0, 0):
             self.angle = -1 * get_angle_between(
                 pygame.mouse.get_pos(),
                 to_screen(scale_pos(self.pos, zoom_factor))) + 90
         if self.thrusting and self.fuel > 0:
             draw(screen, self.sprite_thrusting, draw_pos, self.angle,
                  self.scale, zoom_factor)
         else:
             draw(screen, self.sprite, draw_pos, self.angle, self.scale,
                  zoom_factor)
예제 #3
0
 def draw(self, screen, zoom_factor, offset_pos=(0, 0)):
     draw_pos = (self.pos[0] - offset_pos[0], self.pos[1] - offset_pos[1])
     self.launch_angle = get_angle_between(
         pygame.mouse.get_pos(), to_screen(scale_pos(self.pos,
                                                     zoom_factor)))
     if self.empty:
         draw(screen, self.sprite_pad, draw_pos, self.angle - 90,
              self.scale, zoom_factor)
     else:
         draw(screen, self.sprite_pad, draw_pos, self.angle - 90,
              self.scale, zoom_factor)
         draw(screen, self.sprite_rocket, draw_pos,
              -1 * self.launch_angle + 90, self.scale, zoom_factor)
예제 #4
0
 def draw(self, screen, zoom_factor, offset_pos=(0, 0)):
     draw_pos = (self.pos[0] - offset_pos[0], self.pos[1] - offset_pos[1])
     self.draw_orbit(screen, zoom_factor, offset_pos)
     draw(screen, self.sprite, draw_pos, self.angle, self.scale,
          zoom_factor)
예제 #5
0
 def draw(self, screen, zoom_factor):
     if not self.done:
         draw(screen, self.draw_sprite, self.pos, 0, self.scale,
              zoom_factor)