def initBoat(self, sc, space): boat = Boat(sc, self._listwp[0].X + 15, self.screen.get_size()[1] - self._listwp[0].Y - 50, random.randint(5, 10), space) boat.speed = random.randint(10, 20) * 10 boat.maxspeed = boat.speed return boat
#si est lance : # +retour du bateau a la position de depart if b1.check_is_started(): boat1.body.position = depart.X + 15, fenetre.get_size( )[1] - depart.Y - 50 index_list = 0 b1.change_started_bool() b1.change_appearance() simu.stop() redraw() #si la simulaiton n'est pas lance # +initialisation de la vitesse du bateau else: boat1.speed = 300 b1.change_started_bool() b1.change_appearance() simu.start() redraw_empty() #------------------------------------------------------------------------------------------------------------------------------------------- #----------------------------------------------------------- click sur le bouton "clear" --------------------------------------------------- #------------------------------------------------------------------------------------------------------------------------------------------- elif b2.obj.collidepoint( event.pos) and b1.check_is_started() == False: # vider la liste de waypoint del waypointList[:] #redessiner redraw()