ropy/rp_cmd.py

56 lines
1.6 KiB
Python
Raw Normal View History

2022-08-14 08:03:07 +02:00
import bge # Bibliothèque Blender Game Engine (UPBGE)
from rp_lib import * # Bibliothèque Ropy
###############################################################################
2022-08-19 15:43:20 +02:00
# rp_cmd.py
2022-08-14 08:03:07 +02:00
# @title: Commandes du Robot Ropy
# @project: Ropy (Blender-EduTech)
###############################################################################
###############################################################################
# En: Threads management << DONT CHANGE THIS SECTION >>
# Fr: Gestion des tâches (threads) << NE PAS MODIFIER CETTE SECTION >>
###############################################################################
scene = bge.logic.getCurrentScene()
def start():
scene.objects['Terrain']['thread_cmd']=True
thread_cmd_start(commands)
def stop():
thread_cmd_stop()
def end():
rp_sleep (2)
2022-08-14 08:03:07 +02:00
print ("Thread commands is arrived.")
scene.objects['Terrain']['thread_cmd']=False
###############################################################################
# Fonctions
###############################################################################
###############################################################################
# Commandes
###############################################################################
def commands():
print("Go !!")
rp_gauche()
rp_avancer()
2022-08-14 08:03:07 +02:00
end()
2022-08-14 08:03:07 +02:00
###############################################################################
# En: Externals calls << DONT CHANGE THIS SECTION >>
# Fr: Appels externes << NE PAS MODIFIER CETTE SECTION >>
###############################################################################
if __name__=='start':
start()
if __name__=='stop':
stop()