def update(self)"""update the ship' position based on movement flags ""update the ship' center valuenot the rect if self moving_rightself center +self ai_settings ship_speed_factor if self moving_leftself center -self ai_settings ship_speed_factor update rect object from self center self rect centerx self center def blitme(self)--snip-at uwe add ai_settings to the list of parameters for __init__()so the ship will have access to its speed setting we then turn the ai_settings parameter into an attributeso we can use it in update( now that we're adjusting the position of the ship by fractions of pixelwe need to store the position in variable that can store decimal value you can use decimal value to set rect' attributebut the rect will store only the integer portion of that value to store the ship' position accuratelywe define new attribute self centerwhich can hold decimal values we use the float(function to convert the value of self rect centerx to decimal and store this value in self center now when we change the ship' position in update()the value of self center is adjusted by the amount stored in ai_settings ship_speed_ factor after self center has been updatedwe use the new value to update self rect centerxwhich controls the position of the ship only the integer portion of self center will be stored in self rect centerxbut that' fine for displaying the ship we need to pass ai_settings as an argument when we create an instance of ship in alien_invasion pyalien_ invasion py --snip-def run_game()--snip-make ship ship ship(ai_settingsscreen--snip-now any value of ship_speed_factor greater than one will make the ship move faster this will be helpful in making the ship respond quickly enough to shoot down aliensand it will let us change the tempo of the game as the player progresses in gameplay