예제 #1
0
def draw_environment(car, rot=0):
    """Draw the Environment
    Filling the Background with black color.
    Adding a Rectangle which represents the car.
    TODO: Adding Orientation of the Car
    Updating the Frame.
    :param car: The Car Object which is driving in the screen
    :type car: Car
    """
    game_display.fill(BLACK)
    re = Rectangle(200, 200, 100, 50)
    re.rotate(rot)
    re.move(int(car.x, ), int(car.y))
    pygame.draw.polygon(game_display, WHITE, re.get_point_list(), 5)
    # print(re.get_point_list())
    # Draw Car with fixed Dimensions
    # pygame.draw.rect(game_display, WHITE, [int(car.x), int(car.y), 50, 20], 2)

    # TODO: Rotate Car to Orientation
    # TODO: Add Vector to Steer
    pygame.display.update()