import pygame
import sys
import os
basic stuff
'''
Objects
'''
# put Python classes and functions here
'''
Setup #...
'''
# put run-once code here
fps = 60
ani = 4
clock = pygame.time.Clock()
pygame.init()
I think here might be a problem:
On the internet I saw something with .convert() but it keeps giving me : AttributeError: 'str' object has no attribute 'convert'
when I try to put .conver()
it's been 2 hours of searching and I can't find this noob stuff...
background = pygame.image.load(os.path.join('background.png'))
size = (width, height) = background.get_size()
world = pygame.display.set_mode(size)
...
'''
Main Loop
'''
or here:
world.blit(background, (0,0))
...
while main == True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit(); sys.exit()
main = False
if event.type == pygame.KEYDOWN:
if event.key == ord('q'):
pygame.quit()
sys.exit()
main = False
pygame.display.flip()
clock.tick(fps)