Ok guys I'm back.
I got pygame working on my laptop thankfully.
I've been writing some code to create the screen and get both my little hero dude and the background on the screen. I also found some code to help incorporate user input ...like keys and stuff but I can't seem to get it to work...
import pygame
from pygame.locals import *
screen = pygame.display.set_mode((1024, 768))
background = pygame.image.load('marioscreendesign.bmp')
man = pygame.image.load('superdudepic.bmp')
screen.blit(background, (0,0))
screen.blit(man,(0,0))
pygame.display.flip()
for i in range(100):
screen.fill((0,0,0))
screen.blit(background, (0,0))
screen.blit(man,(i,0))
pygame.display.flip()
pygame.time.delay(50)
while 1:
# USER INPUT
clock.tick(30)
for event in pygame.event.get():
if not hasattr(event, 'key'): continue
down = event.type == KEYDOWN # key down or up?
if event.key == K_RIGHT: k_right = down * 5
elif event.key == K_LEFT: k_left = down * 5
elif event.key == K_UP: k_up = down * 2
elif event.key == K_DOWN: k_down = down * 2
elif event.key == K_ESCAPE: sys.exit(0) # quit the game
screen.fill(BLACK)
compile:
invalid syntax (pygame2.py, line 24)
Traceback (most recent call last):
File "/usr/bin/drpython", line 648, in CheckSyntax
compile(ctext, fn, 'exec')
<type 'exceptions.SyntaxError'>: invalid syntax (pygame2.py, line 24)
this is the error I'm getting and I've tried everything to fix it...but it doesn't want to work. Thanks for the help guys. 'Im new to this and my teacher can't help