i have been playing around in pygame a bit and was wondering if anyone here could help me with moving my image around specifically my self.ball image. And also if anyone could just give me some feedback on my code if its organized or if i could do something different.
Thanks
import pygame
import sys
class Ball:
def __init__(self):
self.ball = pygame.image.load("character/Char.png").convert_alpha()
self.bg = pygame.image.load("Bg/PowLow.png").convert_alpha()
self.ball = pygame.transform.scale(self.ball, (100, 100)).convert_alpha()
def gameloop():
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
def main():
pygame.init()
screen = pygame.display.set_mode((700, 700))
screen.fill("white")
clock = pygame.time.Clock()
b = Ball()
while True:
clock.tick(10)
screen.blit(b.bg, (0, 0))
screen.blit(b.ball, (0, 500))
pygame.display.update()
gameloop()
main()