mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Ajout de la fonction couleur.
This commit is contained in:
parent
8de01c53ac
commit
2f844078ad
BIN
ropy-23.blend
Normal file
BIN
ropy-23.blend
Normal file
Binary file not shown.
14
rp.py
14
rp.py
@ -1144,21 +1144,19 @@ def upgrade_maj():
|
||||
scene.objects['Points']['upgrade_credit']= scene.objects['Points']['level']- 1 - scene.objects['Points']['upgrade_nb']
|
||||
|
||||
# Batterie
|
||||
# FIXME : autonomie non gérée
|
||||
if scene.objects['Points']['upgrade_battery'] :
|
||||
scene.objects['Panels_upgrade'].setVisible(True,True)
|
||||
scene.objects['St-Panels-3'].setVisible(True,True)
|
||||
else:
|
||||
scene.objects['Panels_upgrade'].setVisible(False,True)
|
||||
scene.objects['St-Panels-3'].setVisible(False,True)
|
||||
|
||||
# Balise, voir rp_marquer ()
|
||||
if scene.objects['Points']['upgrade_beacon'] :
|
||||
scene.objects['Cubes_upgrade'].setVisible(True,True)
|
||||
scene.objects['St-Cubes'].setVisible(True,True)
|
||||
else:
|
||||
scene.objects['Cubes_upgrade'].setVisible(False,True)
|
||||
|
||||
# Peinture
|
||||
# FIXME : pas de fontion de peinture
|
||||
scene.objects['St-Cubes'].setVisible(False,True)
|
||||
|
||||
# Peinture (uniquement sous forme de fonction)
|
||||
|
||||
# Vitesse
|
||||
if scene.objects['Points']['upgrade_speed'] :
|
||||
scene.objects['Text_speed'].setVisible(True,True)
|
||||
|
41
rp_cmd.py
41
rp_cmd.py
@ -25,8 +25,6 @@ def mrp_avancer():
|
||||
if rp_detect()==False:
|
||||
rp_avancer()
|
||||
rp_marquer()
|
||||
print ("Nb de balises posées : ", str(rp_balise()))
|
||||
print ("Niveau batterie : ", str(rp_batterie()))
|
||||
|
||||
def mrp_avancer_nbpas(pas):
|
||||
for i in range (pas):
|
||||
@ -40,18 +38,47 @@ def mrp_avancer_mur():
|
||||
# Commandes
|
||||
###############################################################################
|
||||
|
||||
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():
|
||||
|
||||
# rp_couleur("rover", 0)
|
||||
# rp_couleur("rover", (0.5,0.5,0,1))
|
||||
# print ("fini")
|
||||
|
||||
mrp_avancer()
|
||||
rp_couleur("Balise", (1, 0.003, 0.012, 1))
|
||||
rp_couleur("Rover 1", (1, 0.003, 0.012, 1))
|
||||
mrp_avancer()
|
||||
mrp_avancer()
|
||||
mrp_avancer()
|
||||
for i in range(10):
|
||||
rp_couleur("Balise", (1, 0.503, 0.018, 1))
|
||||
rp_tempo(0.1)
|
||||
rp_couleur("Balise", (1, 0.003, 0.012, 1))
|
||||
rp_tempo(0.1)
|
||||
|
||||
# rp_marquer()
|
||||
# rp_gauche()
|
||||
# rp_avancer()
|
||||
# rp_avancer()
|
||||
# mrp_avancer_mur()
|
||||
# rp_gauche()
|
||||
|
||||
# rp_vitesse (8)
|
||||
mrp_avancer_mur()
|
||||
rp_gauche()
|
||||
# rp_vitesse (1)
|
||||
mrp_avancer_mur()
|
||||
# # rp_vitesse (8)
|
||||
# mrp_avancer_mur()
|
||||
# rp_gauche()
|
||||
# # rp_vitesse (1)
|
||||
# mrp_avancer_mur()
|
||||
|
||||
rp_fin()
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
<data>
|
||||
<config>
|
||||
<speed>4.0</speed>
|
||||
<speed>1.0</speed>
|
||||
<sound>False</sound>
|
||||
<cam>
|
||||
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
||||
<worldPosition.y>-26.440298080444336</worldPosition.y>
|
||||
<worldPosition.z>20.22315788269043</worldPosition.z>
|
||||
<worldPosition.x>-4.301222801208496</worldPosition.x>
|
||||
<worldPosition.y>-16.72665786743164</worldPosition.y>
|
||||
<worldPosition.z>17.38153076171875</worldPosition.z>
|
||||
</cam>
|
||||
</config>
|
||||
<mission>
|
||||
<current>6</current>
|
||||
<current>4</current>
|
||||
<level>6</level>
|
||||
</mission>
|
||||
<upgrade>
|
||||
|
15
rp_doc.py
15
rp_doc.py
@ -60,7 +60,8 @@ card_description.update({"tourner-card" : [rp_tourner_title, rp_tourner_text, rp
|
||||
|
||||
# Baliser
|
||||
rp_baliser_title="Baliser"
|
||||
rp_baliser_text=" rp_marquer() \n -> Place une balise sur la case. \n \n Ropy possède que 40 balises, \n il ne peut pas en poser plus."
|
||||
rp_baliser_text=" rp_marquer() \n -> Place une balise sur la case. \n \n Ropy possède que 20 balises, il ne \n peut pas en poser une de plus.\n\n"
|
||||
rp_baliser_text=rp_baliser_text + " Avec l'amélioration \"Balise +\", le \n nombre de balise transportées est \n étendu à 200. \n \n \n \n"
|
||||
rp_baliser_type="standard"
|
||||
card_description.update({"baliser-card" : [rp_baliser_title, rp_baliser_text, rp_baliser_type]})
|
||||
|
||||
@ -72,13 +73,15 @@ card_description.update({"detecter-card" : [rp_detecter_title, rp_detecter_text,
|
||||
|
||||
# Radar
|
||||
rp_radar_title="Radar"
|
||||
rp_radar_text="FIXME"
|
||||
rp_radar_text=" Le radar n'est toujours pas \n opérationnel ! \n\n Mais où est donc encore passé Thomas ! \n\n\n\n\n\n\n\n"
|
||||
rp_radar_type="standard"
|
||||
card_description.update({"radar-card" : [rp_radar_title, rp_radar_text, rp_radar_type]})
|
||||
|
||||
# Speed - Vitesse
|
||||
rp_speed_title="Vitesse"
|
||||
rp_speed_text="FIXME"
|
||||
rp_speed_text=" L'amélioration \"Vitesse\" permet de \n changer la vitesse des déplacements \n par l'interface (en bas à gauche).\n\n"
|
||||
rp_speed_text=rp_speed_text + " La vitesse est modifiable par codage : \n"
|
||||
rp_speed_text=rp_speed_text + " rp_vitesse(nouvelle_vitesse), où \n la vitesse est une valeur de 0,1 à 10.\n\n La fonction rp_vitesse() retourne la \n vitesse actuelle. \n\n\n"
|
||||
rp_speed_type="upgrade"
|
||||
card_description.update({"speed-card" : [rp_speed_title, rp_speed_text, rp_speed_type]})
|
||||
|
||||
@ -90,13 +93,15 @@ card_description.update({"paint-card" : [rp_paint_title, rp_paint_text, rp_paint
|
||||
|
||||
# Battery + - Batterie +
|
||||
rp_battery_title="Batterie +"
|
||||
rp_battery_text="FIXME"
|
||||
rp_battery_text=" L'amélioration \"Batterie +\" permet \n d'augmenter la capacité de la batterie \n du Rover à 200 pas (contre 20 pas). \n\n"
|
||||
rp_battery_text=rp_battery_text + " La fonction rp_batterie() retourne \n la charge actuelle de la batterie \n (valeur de 0 à 100 %).\n\n\n\n\n\n\n"
|
||||
rp_battery_type="upgrade"
|
||||
card_description.update({"battery-card" : [rp_battery_title, rp_battery_text, rp_battery_type]})
|
||||
|
||||
# Beacon + - Balise +
|
||||
rp_beacon_title="Balise +"
|
||||
rp_beacon_text="FIXME"
|
||||
rp_beacon_text=" L'amélioration \"Balise +\" permet \n d'augmenter le nombre de balises \n pouvant être posées à 200 (contre 20). \n\n"
|
||||
rp_beacon_text=rp_beacon_text + " La fonction rp_balise() retourne \n le nombre de balises posées lors du \n trajet. \n\n\n\n\n\n\n\n"
|
||||
rp_beacon_type="upgrade"
|
||||
card_description.update({"beacon-card" : [rp_beacon_title, rp_beacon_text, rp_beacon_type]})
|
||||
|
||||
|
186
rp_lib.py
186
rp_lib.py
@ -256,13 +256,13 @@ def rp_avancer ():
|
||||
if round(obj.worldOrientation.to_euler().z, 2) == round(-math.pi/2,2) or round(obj.worldOrientation.to_euler().z, 2) == round(3*(math.pi/2),2) : # Ouest
|
||||
obj.playAction('Rover-Avancer-X-', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
# obj.worldPosition=[x0-step*i, y0, z0]
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
# scene.objects['Camera'].applyMovement((0, 0, 0), True)
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
@ -306,13 +306,13 @@ def rp_gauche ():
|
||||
ipoFlags = 0
|
||||
speed = scene.objects['Commands']['speed']*8
|
||||
obj.playAction('Rover-Gauche', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
# scene.objects['Camera'].applyMovement((0, 0, 0), True)
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
@ -352,13 +352,13 @@ def rp_droite ():
|
||||
ipoFlags = 0
|
||||
speed = scene.objects['Commands']['speed']*8
|
||||
obj.playAction('Rover-Droite', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Reculer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
# scene.objects['Camera'].applyMovement((0, 0, 0), True)
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
@ -499,12 +499,100 @@ def rp_radar ():
|
||||
# Peindre : station, rover, balise
|
||||
##
|
||||
|
||||
# FIXME tout à définir
|
||||
def rp_couleur (element, new_color):
|
||||
# Couleurs par défaut
|
||||
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)
|
||||
|
||||
# Objets 3D par groupe
|
||||
paint_part ={}
|
||||
all_group_part = ("Rover 1", "Rover 2", "Rover 3", "Station 1", "Station 2", "Station 3", "Station cube 1", "Station cube 2", "Balise", "Stone", "Metal", "Black", "Red windows")
|
||||
paint_part.update({"Stone" : [['Rv-Wheel-left-front', 'Rv-Wheel-right-front','Rv-Wheel-left-mid', 'Rv-Wheel-right-mid', 'Rv-Wheel-left-rear', 'Rv-Wheel-right-rear'],color_stone]}) # Stone
|
||||
paint_part.update({"Metal" : [['Rv-Power source', 'Rv-Mast-arm', 'Rv-Antenna-1', 'St-Sheath'],color_metal]}) # Metal
|
||||
paint_part.update({"Black" : [['St-Block1-foot1','St-Block1-foot2','St-Block1-foot3', 'St-Door-2', 'St-Stair-2','St-Cable1','St-Cable2'],color_black]}) # Black
|
||||
paint_part.update({"Red windows" : [['St-Block1-window','St-Block2-window'],color_windows_red]}) # Red windows
|
||||
|
||||
# Rover
|
||||
rover_partlist =['Rover (Rv-Body-1)', 'Rv-Body-2', 'Rv-Body-3', 'Rv-Body-4', 'Rv-Body-5', 'Rv-Body-6', 'Rv-Body-7',
|
||||
'Rv-Mast', 'Rv-Mast-2', 'Rv-Mast-3', 'Rv-Mast-4', 'Rv-Mast-cap', 'Rv-Mast-arm','Rv-Antenna-1','Rv-Antenna-2','Rv-Antenna-3',
|
||||
'Rv-Power source', 'Rv-Power source-2', 'Rv-Power source-3', 'Rv-Power source-4', 'Rv-Power source-5',
|
||||
'Rv-Wheel-left-front', 'Rv-Wheel-right-front','Rv-Wheel-left-mid', 'Rv-Wheel-right-mid', 'Rv-Wheel-left-rear', 'Rv-Wheel-right-rear']
|
||||
paint_part.update({"Rover 1" : [['Rv-Body-2', 'Rv-Body-7', 'Rv-Power source-2', 'Rv-Power source-5', 'Rv-Mast-3', 'Rv-Mast-4', 'Rv-Mast-cap', 'Rv-Antenna-2'],color_yellow]}) # Jaune
|
||||
paint_part.update({"Rover 2" : [['Rover', 'Rv-Mast', 'Rv-Antenna-3'],color_white]}) # Blanc
|
||||
paint_part.update({"Rover 3" : [['Rv-Body-3', 'Rv-Body-4', 'Rv-Power source-3', 'Rv-Power source-4','Rv-Mast-2'],color_wooddark]}) # WoodDark
|
||||
|
||||
# Station
|
||||
station_partlist =['St-Block1', 'St-Block2', 'St-Block3',
|
||||
'St-Block1-side1', 'St-Block1-side2', 'St-Block1-roof', 'St-Block1-foot1', 'St-Block1-foot2','St-Block1-foot3',
|
||||
'St-Door', 'St-Door-2', 'St-Block1-window', 'St-Stair', 'St-Stair-2', 'St-Stair-3','St-Block1-panel-support',
|
||||
'St-Block2-side', 'St-Block2-window', 'St-Block2-roof',
|
||||
'Block3-side', 'St-Block3-greenhouse', 'St-Block3-greenhouse-base', 'St-Tunnel', 'St-Tube', 'St-Cable1', 'St-Cable2', 'St-Sheath']
|
||||
paint_part.update({"Station 1" : [[ 'St-Door','St-Block1-side1','St-Block2-side','St-Block2-roof'],color_yellow]}) # Jaune
|
||||
paint_part.update({"Station 2" : [[ 'St-Block1','St-Block2','St-Block3','St-Tunnel','St-Tube'],color_white]}) # Blanc
|
||||
paint_part.update({"Station 3" : [[ 'St-Block1-roof', 'St-Block1-side2'],color_stone]}) # Stone
|
||||
paint_part.update({"Station cube 1" : [[ 'St-Cube1-hole','St-Cube2-hole','St-Cube3-hole', 'St-Cube4-hole'],color_yellow]}) # Jaune
|
||||
paint_part.update({"Station cube 2" : [[ 'St-Cubes','St-Cube2','St-Cube3', 'St-Cube4'],color_white]}) # Blanc
|
||||
|
||||
# Balise
|
||||
beacon_partlist =['Beacon_antenne', 'Beacon_sphere']
|
||||
paint_part.update({"Balise" : [['Beacon_antenne', 'Beacon_sphere'],color_light_red]}) # Rouge
|
||||
|
||||
# Mise en couleur
|
||||
def rp_couleur (group_part, new_color):
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
print ("Nouvelle couleur :", str(new_color),"->", element)
|
||||
print ("Nouvelle couleur :", str(new_color),"->", element)
|
||||
print ("Nouvelle couleur :", str(new_color),"->", group_part)
|
||||
if group_part != "Balise":
|
||||
for i in range (len(paint_part[group_part][0])):
|
||||
scene.objects[paint_part[group_part][0][i]].color = new_color
|
||||
else:
|
||||
for i in range (200):
|
||||
beacon = scene.objects["Beacon-"+str(i)]
|
||||
beacon.children[0].color = new_color
|
||||
beacon.children[1].color = new_color
|
||||
|
||||
def rp_couleur_detail (part, new_color):
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
print ("Nouvelle couleur :", str(new_color),"->", part)
|
||||
scene.objects[part].color = new_color
|
||||
|
||||
# Initialisation de la couleur
|
||||
def rp_couleur_init (group_part=None):
|
||||
if group_part is not None:
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
print ("Réinitialisation couleur ->", group_part)
|
||||
for i in range (len(paint_part[group_part][0])):
|
||||
scene.objects[paint_part[group_part][0][i]].color = paint_part[group_part][1]
|
||||
return (paint_part[group_part][1])
|
||||
else:
|
||||
for i in range (len(all_group_part)):
|
||||
for j in range (len(paint_part[all_group_part[i]][0])):
|
||||
print(paint_part[all_group_part[i]])
|
||||
scene.objects[paint_part[all_group_part[i]][0][j]].color = paint_part[all_group_part[i]][1]
|
||||
|
||||
# def rp_couleur_init_detail (element):
|
||||
# if scene.objects['Points']['upgrade_paint']:
|
||||
# if (debug_mvt):
|
||||
# print ("Réinitialisation couleur ->", element)
|
||||
# scene.objects[element].color = init_color
|
||||
|
||||
# Affichage de la liste des composants 3D
|
||||
def rp_couleur_listedetail (element, new_color):
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if element=="Rover":
|
||||
print ("Composants 3D du Rover :", rover_partlist)
|
||||
if element=="Station":
|
||||
print ("Composants 3D de la Station :", station_partlist)
|
||||
if element=="Balise":
|
||||
print ("Composants 3D d'une Balise :", beacon_partlist)
|
||||
|
||||
##
|
||||
# Changer la vitesse
|
||||
@ -572,13 +660,13 @@ def rover_colision_montain ():
|
||||
if round(obj.worldOrientation.to_euler().z, 2) == round(-math.pi/2,2) or round(obj.worldOrientation.to_euler().z, 2) == round(3*(math.pi/2),2) : # Ouest
|
||||
obj.playAction('Rover-Crash-X-', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
return True
|
||||
@ -609,13 +697,13 @@ def rover_colision_station ():
|
||||
if round(obj.worldOrientation.to_euler().z, 2) == round(-math.pi/2,2) or round(obj.worldOrientation.to_euler().z, 2) == round(3*(math.pi/2),2) : # Ouest
|
||||
obj.playAction('Rover-CrashStation-X-', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
return True
|
||||
@ -650,17 +738,15 @@ def rover_goal ():
|
||||
|
||||
speed = scene.objects['Commands']['speed']
|
||||
scene.objects['Rover'].playAction('Rover-Aim1', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Mast'].playAction('Mast-Aim1', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Mast-cap'].playAction('Mast-cap-Aim1', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
|
||||
scene.objects['Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
|
||||
while scene.objects['Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Rv-Mast'].playAction('Mast-Aim1', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Mast-cap'].playAction('Mast-cap-Aim1', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-right-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-front'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-mid'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Rv-Wheel-left-rear'].playAction('Wheel-Avancer', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
while scene.objects['Rv-Wheel-right-front'].isPlayingAction(): # Forçage du redraw
|
||||
scene.objects['Sun'].applyMovement((0, 0, 0), True)
|
||||
rp_tempo (0.1)
|
||||
|
||||
|
@ -110,7 +110,7 @@ mission_6_title="Mission 6\n Se rendre utile"
|
||||
mission_6_text="\n \n Une zone précise du terrain présente \n des carottages afin d'analyser la \n roche. \n \n Les lieux de forage sont définis de \n manière aléatoire (encore !), pour les \n réaliser, Ropy doit donc passer sur \n toutes les cases de la zone. \n \n \n \n \n \n \n"
|
||||
mission_6_task = "- Passer sur les 10 \n lieux de forage"
|
||||
mission_6_init=[0.0,0.0, "e"] # Position aléatoire tourné vers l'est -> défini dans le reset
|
||||
mission_6_aim=[100.0,100.0] # Aim caché -> rammassage de pierre
|
||||
mission_6_aim=[100.0,100.0] # Aim caché -> ramassage de pierre
|
||||
missions_card_description.update({"mission_6-card" : [mission_6_title, mission_6_text]})
|
||||
missions_conf.update({"6" : [mission_6_init, mission_6_aim]})
|
||||
missions_task.update({"6" : [mission_6_task]})
|
||||
@ -148,6 +148,8 @@ def get_card_description():
|
||||
##
|
||||
|
||||
def map_init():
|
||||
|
||||
# Terrain
|
||||
scene.objects['Terrain']['size'] = [-15,-11,15,10] # Map size
|
||||
scene.objects['Terrain']['map_tile_montain']= []
|
||||
scene.objects['Terrain']['map_tile_station']= [[-9,2],[-9,3]]
|
||||
@ -155,6 +157,9 @@ def map_init():
|
||||
if "terrain_sideCliff" in obj_i.name or "terrain_sideCorner" in obj_i.name or "terrain_sideCornerInner" in obj_i.name:
|
||||
scene.objects['Terrain']['map_tile_montain'].append([round(obj_i.worldPosition.x), round(obj_i.worldPosition.y)])
|
||||
|
||||
# Couleurs
|
||||
rp_couleur_init()
|
||||
|
||||
# Cacher les zones
|
||||
scene.objects['Aim'].setVisible(False,True)
|
||||
scene.objects['Initzone-mission-5'].setVisible(False,True)
|
||||
@ -191,7 +196,7 @@ def map_reset():
|
||||
mission_aim = missions_conf[str(scene.objects['Points']['mission'])][1]
|
||||
|
||||
# Cacher les balises
|
||||
for i in range (100):
|
||||
for i in range (200):
|
||||
beacon = scene.objects["Beacon-"+str(i)]
|
||||
beacon.worldPosition=[29,1+i,0.2]
|
||||
beacon.setVisible(False,True)
|
||||
|
@ -47,7 +47,7 @@ storecard_description.update({"Store-paint-card" : [sc_paint_title, sc_paint_tex
|
||||
|
||||
# Battery + - Batterie +
|
||||
sc_battery_title="Batterie +"
|
||||
sc_battery_text="Augmente la capacité \nde la batterie à 200 \nmouvements (contre \n50)."
|
||||
sc_battery_text="Augmente la capacité \nde la batterie à 200 \nmouvements (contre \n20, plutôt faible ...)."
|
||||
storecard_description.update({"Store-battery-card" : [sc_battery_title, sc_battery_text]})
|
||||
|
||||
# Beacon + - Balise +
|
||||
|
Loading…
Reference in New Issue
Block a user