Advertising (This ad goes away for registered users. You can Login or Register)

psp2d movement errors

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
User avatar
bronywhocodes
Posts: 21
Joined: Mon Dec 07, 2015 7:19 am

psp2d movement errors

Post by bronywhocodes » Thu Dec 10, 2015 3:27 am

hello.

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()
nothing happens. (i am new to this so, i dont know what the D does :P)

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()
i get an error:
ValueError: subsurface rectangle outside surface area


what may i be doing wrong?

thks :D
Advertising
I am a coder. Python is My favourite. Also, here's my consoles that I can hack

Wii [unhacked (plz tutorial on how to code for wii)]
Psp go (6.61 pro cfw unbridled)

User avatar
bronywhocodes
Posts: 21
Joined: Mon Dec 07, 2015 7:19 am

Re: psp2d movement errors

Post by bronywhocodes » Sat Dec 19, 2015 9:31 pm

bump
Advertising
I am a coder. Python is My favourite. Also, here's my consoles that I can hack

Wii [unhacked (plz tutorial on how to code for wii)]
Psp go (6.61 pro cfw unbridled)

User avatar
bronywhocodes
Posts: 21
Joined: Mon Dec 07, 2015 7:19 am

Re: psp2d movement errors

Post by bronywhocodes » Wed Jan 13, 2016 1:19 am

wait a tick! i think the blit would of had to been in a tuple.

though i have deleted psp2d, i may come back to this later!
I am a coder. Python is My favourite. Also, here's my consoles that I can hack

Wii [unhacked (plz tutorial on how to code for wii)]
Psp go (6.61 pro cfw unbridled)

Post Reply

Return to “Programming and Security”