import bge # Bibliothèque Blender Game Engine (UPBGE) from rp_lib import * # Bibliothèque Ropy ############################################################################### # rp_cmd.py # @title: Commandes pour le Rover Ropy # @project: Ropy (Blender-EduTech) ############################################################################### ############################################################################### # Initialisation du niveau : # Niveau 1 : Les premiers pas de Ropy # Niveau 2 : Ma première fonction # Niveau 3 : Sécuriser Ropy # Niveau 4 : Partir au bout du monde # Niveau 5 : Faire face à l'inconnu # Niveau 6 : Se rendre utile ############################################################################### ############################################################################### # Fonctions ############################################################################### def mrp_avancer(): if rp_detect()==False: rp_avancer() rp_marquer() def mrp_avancer_nbpas(pas): for i in range (pas): mrp_avancer() def mrp_avancer_mur(): while rp_detect()==False: mrp_avancer() ############################################################################### # Commandes ############################################################################### def commandes(): print("Go !!") rp_marquer() rp_gauche() mrp_avancer_mur() rp_droite() mrp_avancer_mur() rp_gauche() mrp_avancer_mur() print ("fin") rp_fin() ############################################################################### # En: Externals calls << DONT CHANGE THIS SECTION >> # Fr: Appels externes << NE PAS MODIFIER CETTE SECTION >> ############################################################################### if __name__=='start': thread_cmd_start(commandes) if __name__=='stop': thread_cmd_stop()