Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#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