0
import math
import pygame
pygame.transform.scale

pygame.init()

WIDTH, HEIGHT = 800, 500
win = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Brick Breaker")

FPS = 60
PADDLE_WIDTH = 100
PADDLE_HEIGHT = 15
BALL_RADIUS = 10


LIVES_FONT = pygame.font.SysFont("comics-ans", 50)

pokeball = pygame.image.load("ultraball.jpg")
pygame.transform.scale(pokeball, (1, 1))


background = pygame.image.load("python game background 1.jpg")
background = pygame.transform.scale(background, (800, 500))

class Ball:
    VEL = 5

    def __init__(self, x, y, radius, color, image):
        self.x = x
        self.y = y
        self.radius = radius
        self.color = "white"
        self.x_vel = 0
        self.y_vel = -self.VEL

    def move(self):
        self.x += self.x_vel
        self.y += self.y_vel

    def set_vel(self, x_vel, y_vel):
        self.x_vel = x_vel
        self.y_vel = y_vel

    def draw(win):
        win.image.load(pokeball)
        win.image.scale(pokeball, (1, 1))

i watch some turorial online and on youtube but most tutorials are for attaching an image and moving around, what im trying to do is add the pokeball, resize pokeball and make it move just like the circle was moving.

0 Answers0