mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Bugfix : script sans mouvement
This commit is contained in:
parent
3510919241
commit
2398377909
BIN
ropy-28.blend
BIN
ropy-28.blend
Binary file not shown.
3
rp.py
3
rp.py
@ -237,9 +237,10 @@ def terrain_run ():
|
|||||||
|
|
||||||
# Démarrage de la map
|
# Démarrage de la map
|
||||||
if scene.objects['Terrain']['thread_cmd']==False:
|
if scene.objects['Terrain']['thread_cmd']==False:
|
||||||
|
time.sleep(0.125)
|
||||||
scene.objects['Terrain']['thread_cmd']=True
|
scene.objects['Terrain']['thread_cmd']=True
|
||||||
rp_map.map_reset()
|
rp_map.map_reset()
|
||||||
time.sleep(0.25)
|
time.sleep(0.125)
|
||||||
|
|
||||||
# Nombre de ligne du script Python
|
# Nombre de ligne du script Python
|
||||||
# print (os.getcwd())
|
# print (os.getcwd())
|
||||||
|
47
rp_cmd.py
47
rp_cmd.py
@ -22,58 +22,15 @@ from rp_lib import * # Bibliothèque Ropy
|
|||||||
# Fonctions
|
# Fonctions
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
def mrp_marquer_couleur():
|
|
||||||
global j
|
|
||||||
rp_marquer()
|
|
||||||
time.sleep(1)
|
|
||||||
rp_couleur("Balise "+str(j), (j/100, j/100, 1, 1)) # Balise
|
|
||||||
j+=1
|
|
||||||
|
|
||||||
def mrp_avancer():
|
|
||||||
if rp_detect()==False:
|
|
||||||
rp_avancer()
|
|
||||||
rp_marquer()
|
|
||||||
# mrp_marquer_couleur()
|
|
||||||
|
|
||||||
def mrp_avancer_nbpas(pas):
|
|
||||||
for i in range (pas):
|
|
||||||
mrp_avancer()
|
|
||||||
|
|
||||||
def mrp_avancer_mur():
|
|
||||||
while rp_detect()==False:
|
|
||||||
mrp_avancer()
|
|
||||||
|
|
||||||
def mrp_avancer_mur_sb(): # sb = sans balise
|
|
||||||
while rp_detect()==False:
|
|
||||||
rp_avancer()
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Commandes
|
# Commandes
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
def commandes():
|
def commandes():
|
||||||
|
|
||||||
# Mission 6
|
# Ecrire votre code ici ...
|
||||||
rp_gauche()
|
|
||||||
mrp_avancer_mur_sb()
|
|
||||||
rp_droite()
|
|
||||||
mrp_avancer_mur_sb()
|
|
||||||
rp_gauche()
|
|
||||||
mrp_avancer_mur_sb()
|
|
||||||
rp_gauche()
|
|
||||||
|
|
||||||
for i in range (5):
|
|
||||||
mrp_avancer_nbpas(9)
|
|
||||||
rp_gauche()
|
|
||||||
mrp_avancer()
|
|
||||||
rp_gauche()
|
|
||||||
mrp_avancer_nbpas(9)
|
|
||||||
rp_droite()
|
|
||||||
mrp_avancer()
|
|
||||||
rp_droite()
|
|
||||||
|
|
||||||
rp_fin()
|
rp_fin() # A garder
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# En: Externals calls << DONT CHANGE THIS SECTION >>
|
# En: Externals calls << DONT CHANGE THIS SECTION >>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<data>
|
<data>
|
||||||
<config>
|
<config>
|
||||||
<speed>4.0</speed>
|
<speed>1.0</speed>
|
||||||
<sound>False</sound>
|
<sound>False</sound>
|
||||||
<cam>
|
<cam>
|
||||||
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
||||||
|
@ -133,7 +133,9 @@ def thread_gostore_stop():
|
|||||||
def rp_end():
|
def rp_end():
|
||||||
if (debug_thread):
|
if (debug_thread):
|
||||||
print ("Thread commands is arrived.")
|
print ("Thread commands is arrived.")
|
||||||
|
time.sleep(0.125)
|
||||||
scene.objects['Terrain']['thread_cmd']=False
|
scene.objects['Terrain']['thread_cmd']=False
|
||||||
|
time.sleep(0.125)
|
||||||
|
|
||||||
def rp_fin():
|
def rp_fin():
|
||||||
rp_end()
|
rp_end()
|
||||||
|
Loading…
Reference in New Issue
Block a user