Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualnimrodson

Posted 02 February 2013 - 09:14 AM

What is self.rect.center? And why do you need to call `toPoint' on self.center? What is self.center if not a point?

self.rect.center is a python tuple. I need to set it to render the spaceship later, and it doesn't accept a "vector". toPoint() method converts a vector in a tuple. I know, it seems ugly but i couldn't figure out how deal with it.

 

EDIT: I hadn't understood your full answer but now it's clear to me. Thank you very much!


#3nimrodson

Posted 02 February 2013 - 09:13 AM

What is self.rect.center? And why do you need to call `toPoint' on self.center? What is self.center if not a point?

self.rect.center is a python tuple. I need to set it to render the spaceship later, and it doesn't accept a "vector". toPoint() method converts a vector in a tuple. I know, it seems ugly but i couldn't figure out how deal with it.

 

EDIT: I didn't understand your full answer, but now it's clear to me. Thank you very much!


#2nimrodson

Posted 02 February 2013 - 09:04 AM

What is self.rect.center? And why do you need to call `toPoint' on self.center? What is self.center if not a point?

self.rect.center is a python tuple. I need to set it to render the spaceship later, and it doesn't accept a "vector". toPoint() method converts a vector in a tuple. I know, it seems ugly but i couldn't figure out how deal with it.

 

 

EDIT: Oh, the tricky part with using heading as a length-one vector is how to rotate it when the user presses a key.

 

Are you suggesting that self.heading has to be a length-one vector? Because i can't see where is the rotation in this bit: self.step * self.heading.

 

Thank you


#1nimrodson

Posted 02 February 2013 - 09:03 AM

What is self.rect.center? And why do you need to call `toPoint' on self.center? What is self.center if not a point?

self.rect.center is a python tuple. I need to set it to render the spaceship later, and it doesn't accept a "vector". toPoint() method converts a vector in a tuple. I know, it seems ugly but i couldn't figure out how deal with it.

 

EDIT: Oh, the tricky part with using heading as a length-one vector is how to rotate it when the user presses a key.

 

Are you suggesting that self.heading have to be a length-one vector? Because i can't see where is the rotation in this bit: self.step * self.heading.

 

Thank you


PARTNERS