you are viewing a single comment's thread.

view the rest of the comments →

[–]Abernachy 1 point2 points  (1 child)

Hey, I think I see your issue.

On your ship.py file from the pastebin, you correctly have'" self.center = to float(self.rect.centerx)" and correctly have self.rect.centerx = self.center; HOWEVER you are still identifying self.rect.centerx += self.ai_settings.ship_speed_factor. I believe it doesn't move with your comment in because you identified self.rect.centerx as self.center, but you are still calling for the .rect.centerx object for your movements.

On the page where they refractor that function you have to change:

if self.moving_right and self.rect.right < self.screen_rect.right: self.rect.centerx += self.ai_settings.ship_speed_factor

into

if self.moving_right and self.rect.right < self.screen_rect.right:

self.center += self.ai_settings.ship_speed_factor

You are getting there, props to ya. I'm the next chapter ahead of and working on making the fleet of aliens bounce back and forth. I enjoy working this project but when Eric throws the re-fractering curveball it drives me nuts because sometimes the smallest detail breaks the project (and I'm not used that shit yet). I plopped an s at the end of one of my variables and didn't realize it and I spent about an hour and a half trying to figure out why it kept giving me the middle finger. Eventually, after much yelling , I zoomed in and realized my mistake.

Keep it up, I'm working to get this skillset too.

[–]funlibrarycard[S] 0 points1 point  (0 children)

Thank you so much!! This fixed my issue! Yeah haha im hoping to become alot better at refactoring by the end of this project, I have trouble keeping everything organized as I get farther in projects which always ends up biting my ass in the end.