while using the psp2d module to code i have ran into a pickle when it comes to making a sprite move.
when i use this:
Code: Select all
import psp2d
screen = psp2d.Screen()
CLEAR_COLOUR = psp2d.Color(0,0,0)
pad = psp2d.Controller()
character = psp2d.Image("char1.png")
stillgame = True
while stillgame == True:
x = 50
y = 50
yChange = 0
xChange = 0
if pad.left:
xChange = -10
if pad.right:
xChange = 10
x += xChange
screen.clear(CLEAR_COLOUR)
screen.blit(character,dx = x,dy = y)
screen.swap()
and when i do this:
Code: Select all
import psp2d
screen = psp2d.Screen()
CLEAR_COLOUR = psp2d.Color(0,0,0)
pad = psp2d.Controller()
character = psp2d.Image("char1.png")
stillgame = True
while stillgame == True:
x = 50
y = 50
yChange = 0
xChange = 0
if pad.left:
xChange = -10
if pad.right:
xChange = 10
x += xChange
screen.clear(CLEAR_COLOUR)
screen.blit(character,x,y)
screen.swap()
ValueError: subsurface rectangle outside surface area
what may i be doing wrong?
thks
Advertising