ropy/rp_cmd.py

109 lines
3.2 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
# @title: Commandes pour le Rover Ropy
2022-08-14 08:03:07 +02:00
# @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
###############################################################################
2022-08-14 08:03:07 +02:00
###############################################################################
# Fonctions
###############################################################################
2022-08-26 01:58:49 +02:00
def mrp_avancer():
2022-09-22 06:44:37 +02:00
if rp_detect()==False:
rp_avancer()
rp_marquer()
2022-08-14 08:03:07 +02:00
2022-09-24 04:53:54 +02:00
def mrp_avancer_nbpas(pas):
for i in range (pas):
mrp_avancer()
def mrp_avancer_mur():
while rp_detect()==False:
mrp_avancer()
2022-08-14 08:03:07 +02:00
###############################################################################
# Commandes
###############################################################################
2022-10-03 14:02:01 +02:00
color_yellow = (1, 0.503, 0.018, 1)
color_black = (0.019794, 0.032076, 0.037408, 1)
color_white = (0.799, 0.799, 0.799, 1)
color_windows_red = (0.617, 0.037, 0.019, 1)
color_area_red = (1, 0.003, 0.012, 1) # Balise
color_light_red = (1, 0.003, 0.012, 1) # Balise
color_stone = (0.191, 0.227, 0.246, 1)
color_wooddark = (0.153, 0.117, 0.107, 1)
color_metal = (0.401, 0.478, 0.518, 1)
def commandes():
2022-08-14 08:03:07 +02:00
2022-10-03 14:02:01 +02:00
# rp_couleur("rover", 0)
# rp_couleur("rover", (0.5,0.5,0,1))
# print ("fini")
mrp_avancer()
2022-10-03 23:57:16 +02:00
2022-10-03 14:02:01 +02:00
rp_couleur("Rover 1", (1, 0.003, 0.012, 1))
2022-10-03 23:57:16 +02:00
rp_couleur("Rover 2", (1, 0.003, 0.012, 1))
rp_couleur("Rover 3", (1, 0.003, 0.012, 1))
rp_couleur("Station 1", (1, 0.003, 0.012, 1))
rp_couleur("Station 2", (1, 0.003, 0.012, 1))
rp_couleur("Station 3", (1, 0.003, 0.012, 1))
rp_couleur("Station 4", (1, 0.003, 0.012, 1))
rp_couleur("Station cube 1", (1, 0.003, 0.012, 1))
rp_couleur("Station cube 2", (1, 0.003, 0.012, 1))
2022-10-03 14:02:01 +02:00
2022-10-03 23:57:16 +02:00
for i in range(20):
mrp_avancer()
for i in range(20):
rp_couleur("Balise "+str(i), (1, 1-i/19, 1-i/19, 1))
rp_droite()
# rp_couleur_init("Station 1")
# rp_couleur_init("Station 2")
# rp_couleur_init("Station 3")
# rp_couleur_init("Station 4")
# rp_couleur_init()
2022-09-30 06:59:52 +02:00
# rp_marquer()
# rp_gauche()
2022-10-03 14:02:01 +02:00
# rp_avancer()
# rp_avancer()
2022-09-30 06:59:52 +02:00
# mrp_avancer_mur()
# rp_gauche()
2022-10-03 14:02:01 +02:00
# # rp_vitesse (8)
# mrp_avancer_mur()
# rp_gauche()
# # rp_vitesse (1)
# mrp_avancer_mur()
2022-09-24 04:53:54 +02:00
rp_fin()
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':
thread_cmd_start(commandes)
2022-08-14 08:03:07 +02:00
if __name__=='stop':
thread_cmd_stop()