mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Bugfix : rendu dégradée de la carte mission après l'affichage de la grille.
This commit is contained in:
parent
52b760c946
commit
bfcd674677
BIN
ropy-07.blend
BIN
ropy-07.blend
Binary file not shown.
92
rp.py
92
rp.py
@ -70,9 +70,15 @@ color_text_orange = (0.799, 0.176, 0.054, 1)
|
||||
color_text_yellow = (0.799, 0.617, 0.021, 1)
|
||||
|
||||
# Sounds
|
||||
# audiodev = aud.Device()
|
||||
# snd_click = aud.Sound('asset/sounds/click.ogg')
|
||||
audiodev = aud.Device()
|
||||
snd_click = aud.Sound('asset/sounds/rp_click.ogg')
|
||||
# sndbuff_click = aud.Sound.cache(snd_click)
|
||||
snd_open = aud.Sound('asset/sounds/rp_open.ogg')
|
||||
# sndbuff_open = aud.Sound.cache(snd_open)
|
||||
snd_close = aud.Sound('asset/sounds/rp_close.ogg')
|
||||
# sndbuff_close = aud.Sound.cache(snd_close)
|
||||
snd_grid = aud.Sound('asset/sounds/rp_grid.ogg')
|
||||
# sndbuff_grid = aud.Sound.cache(snd_grid)
|
||||
|
||||
# UPBGE constants
|
||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||
@ -109,8 +115,6 @@ def points_maj (cont):
|
||||
|
||||
def terrain_init ():
|
||||
|
||||
# Cacher les fenêtres
|
||||
|
||||
# Ajout du Hud
|
||||
scene.active_camera = scene.objects["Camera"]
|
||||
scene.objects['Sun'].setVisible(True,True)
|
||||
@ -128,7 +132,6 @@ def terrain_init ():
|
||||
##
|
||||
|
||||
def terrain_run ():
|
||||
# sound_play (sndbuff_click)
|
||||
|
||||
# Pause
|
||||
# FIXME : HL alors que c'est avec les touches
|
||||
@ -140,7 +143,8 @@ def terrain_run ():
|
||||
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||
scene.objects['Run']. restorePhysics()
|
||||
scene.objects['Run-Hl'].setVisible(True,False)
|
||||
scene.objects['Cmd-text']['Text']= "Run (F5)"
|
||||
scene.objects['Cmd-text']['Text']= "Exécuter (F5)"
|
||||
# scene.objects['Cmd-text']['Text']= "Run (F5)"
|
||||
scene.objects['Cmd-text'].setVisible(True,False) # FIXME : suppresion de du message
|
||||
|
||||
# Run
|
||||
@ -178,7 +182,6 @@ def terrain_run ():
|
||||
##
|
||||
|
||||
def terrain_stop ():
|
||||
# sound_play (sndbuff_click)
|
||||
|
||||
# Arrêt des threads utilisateurs
|
||||
scene.objects['Terrain']['run']=False
|
||||
@ -216,21 +219,20 @@ def terrain_end ():
|
||||
##
|
||||
|
||||
def terrain_speed (obj):
|
||||
# sound_play (sndbuff_click)
|
||||
speed_mode=[0.25, 0.5, 1,2,4,10]
|
||||
speed_mode_txt=["1/4", "1/2", "1", "2","4","10"]
|
||||
i=speed_mode.index(scene.objects['Terrain']['speed'])
|
||||
i=speed_mode.index(scene.objects['Commands']['speed'])
|
||||
|
||||
# Affichage
|
||||
if obj.name=="Speed_up" and i<5:
|
||||
scene.objects['Terrain']['speed']=speed_mode[i+1]
|
||||
scene.objects['Commands']['speed']=speed_mode[i+1]
|
||||
scene.objects['Text_speed']['Text']=speed_mode_txt[i+1]
|
||||
if obj.name=="Speed_down" and i>0:
|
||||
scene.objects['Terrain']['speed']=speed_mode[i-1]
|
||||
scene.objects['Commands']['speed']=speed_mode[i-1]
|
||||
scene.objects['Text_speed']['Text']=speed_mode_txt[i-1]
|
||||
|
||||
# Maj du fichier de config (vitesse du jeu : data/config/speed)
|
||||
rp_config_tree[0][0].text=str(scene.objects['Terrain']['speed'])
|
||||
rp_config_tree[0][0].text=str(scene.objects['Commands']['speed'])
|
||||
buffer_xml = ET.tostring(rp_config_tree)
|
||||
with open("rp_config.xml", "wb") as f:
|
||||
f.write(buffer_xml)
|
||||
@ -240,14 +242,23 @@ def terrain_speed (obj):
|
||||
##
|
||||
|
||||
def terrain_grid ():
|
||||
# for i in range (0, 1000, 1):
|
||||
# bpy.data.materials["Grid"].node_tree.nodes["Emission"].inputs[1].default_value =i*0.01
|
||||
# pass
|
||||
if scene.objects['Grid-u'].visible:
|
||||
scene.objects['Grid-u'].setVisible(False,True)
|
||||
scene.objects['Grid-v'].setVisible(False,True)
|
||||
else:
|
||||
scene.objects['Grid-u']['timer'] = 0.3
|
||||
bpy.data.materials["Grid"].node_tree.nodes["Emission"].inputs[1].default_value =scene.objects['Grid-u']['timer']
|
||||
# bpy.data.materials["Grid"].node_tree.nodes["Emission"].inputs[1].default_value =0.3
|
||||
scene.objects['Grid-u'].setVisible(True,True)
|
||||
scene.objects['Grid-v'].setVisible(True,True)
|
||||
scene.objects['Grid-u']['anim'] = True
|
||||
|
||||
def terrain_grid_anim ():
|
||||
bpy.data.materials["Grid"].node_tree.nodes["Emission"].inputs[1].default_value =scene.objects['Grid-u']['timer']
|
||||
scene.objects['Grid-u']['timer']+=0.01
|
||||
if scene.objects['Grid-u']['timer']== 2:
|
||||
scene.objects['Grid-u']['anim'] = False
|
||||
|
||||
###############################################################################
|
||||
# Sons
|
||||
@ -255,6 +266,7 @@ def terrain_grid ():
|
||||
|
||||
def sound_play (sound):
|
||||
if scene.objects['Commands']['sound']:
|
||||
# playsound('rp_click.ogg')
|
||||
audiodev.play(sound)
|
||||
|
||||
def sound_set ():
|
||||
@ -353,8 +365,8 @@ def cmd_init():
|
||||
# Read config (game speed : data/config/speed -> [0][0].text)
|
||||
speed_mode=[0.25, 0.5, 1,2,4,10]
|
||||
speed_mode_txt=["1/4", "1/2", "1", "2","4","10"]
|
||||
scene.objects['Terrain']['speed']=float(rp_config_tree[0][0].text)
|
||||
i=speed_mode.index(scene.objects['Terrain']['speed'])
|
||||
scene.objects['Commands']['speed']=float(rp_config_tree[0][0].text)
|
||||
i=speed_mode.index(scene.objects['Commands']['speed'])
|
||||
scene.objects['Text_speed']['Text']=speed_mode_txt[i]
|
||||
|
||||
# Windows
|
||||
@ -364,8 +376,8 @@ def cmd_init():
|
||||
rp_doc.init()
|
||||
|
||||
# Missions
|
||||
# Read config (game speed : data/config/mission_current -> [0][2].text)
|
||||
# Read config (game speed : data/config/mission_success -> [0][3].text)
|
||||
# Read config (mission actuelle : data/config/mission_current -> [0][2].text)
|
||||
# Read config (niveau atteint : data/config/mission_success -> [0][3].text)
|
||||
scene.objects['Terrain']['mission_current']=int(rp_config_tree[0][2].text)
|
||||
scene.objects['Terrain']['mission_success']=int(rp_config_tree[0][3].text)
|
||||
scene.objects['Points-Map-text']['Text']="Mission "+str(scene.objects['Terrain']['mission_current'])
|
||||
@ -400,9 +412,9 @@ def cmd_hl(cont):
|
||||
|
||||
# Text
|
||||
text_hl ={"Run":"Exécuter (F5)",
|
||||
"Stop":"Stop (F6)",
|
||||
"Stop":"Stop et initialisation (F6)",
|
||||
"Pause":"Pause (F5)",
|
||||
"Objective":"Afficher objectif",
|
||||
"Objective":"Afficher/cacher l'objectif",
|
||||
"Doc-cmd":"Documentation",
|
||||
"ResetView": "Reset de la vue (Touche Début)",
|
||||
"About-cmd": "A propos",
|
||||
@ -466,23 +478,32 @@ def cmd_hl(cont):
|
||||
def cmd_click (cont):
|
||||
obj = cont.owner
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive and scene.objects['Terrain']['manip_mode']==0:
|
||||
|
||||
if obj.name=="Pause" or obj.name=="Run":
|
||||
sound_play (snd_click)
|
||||
terrain_run ()
|
||||
if obj.name=="Stop":
|
||||
sound_play (snd_click)
|
||||
terrain_stop ()
|
||||
if obj.name=="Objective":
|
||||
sound_play (snd_grid)
|
||||
terrain_grid ()
|
||||
if obj.name=="Speed_up" or obj.name=="Speed_down":
|
||||
sound_play (snd_click)
|
||||
terrain_speed (obj)
|
||||
if obj.name=="ResetView":
|
||||
sound_play (snd_click)
|
||||
manip_reset()
|
||||
if obj.name=="Sound-cmd":
|
||||
sound_unset ()
|
||||
if obj.name=="NoSound-cmd":
|
||||
sound_set ()
|
||||
sound_play (snd_click)
|
||||
if obj.name=="Doc-cmd":
|
||||
sound_play (snd_open)
|
||||
tablet_open ()
|
||||
if obj.name=="About-cmd":
|
||||
sound_play (snd_open)
|
||||
about_open ()
|
||||
|
||||
###############################################################################
|
||||
@ -587,9 +608,6 @@ def manip_init(cont):
|
||||
scene.objects['Terrain']['init_rx']=scene.objects['Terrain'].worldOrientation.to_euler().x
|
||||
scene.objects['Terrain']['init_ry']=scene.objects['Terrain'].worldOrientation.to_euler().y
|
||||
scene.objects['Terrain']['init_rz']=scene.objects['Terrain'].worldOrientation.to_euler().z
|
||||
# scene.objects['Points-Map-text']['init_relativ_lx']=scene.objects['Points-Map-text'].worldPosition.x-scene.objects['Points'].worldPosition.x
|
||||
# scene.objects['Points-Map-text']['init_relativ_ly']=scene.objects['Points-Map-text'].worldPosition.y-scene.objects['Points'].worldPosition.y
|
||||
# scene.objects['Points-Map-text']['init_relativ_lz']=scene.objects['Points-Map-text'].worldPosition.z-scene.objects['Points'].worldPosition.z
|
||||
|
||||
##
|
||||
# Atteindre une orientation (bas niveau)
|
||||
@ -817,27 +835,12 @@ def tablet_open ():
|
||||
manip_reset()
|
||||
|
||||
# Overlay
|
||||
|
||||
# scene.objects['Points-Step-text'].setVisible(False,True)
|
||||
# scene.objects['Points-Level-text'].setVisible(False,True)
|
||||
# scene.objects['Points-Nbligne-text'].setVisible(False,True)
|
||||
# scene.objects['Level'].setVisible(False,True)
|
||||
|
||||
scene.removeOverlayCollection(bpy.data.collections['Hud'])
|
||||
scene.objects['Points'].setVisible(False,True)
|
||||
scene.objects['Commands'].setVisible(False,True)
|
||||
scene.active_camera = scene.objects["Camera-Hud"]
|
||||
scene.objects['Camera'].setVisible(False,True)
|
||||
|
||||
# scene.objects['Sun'].setVisible(False,False)
|
||||
# scene.objects['Book-cmd'].setVisible(False,False)
|
||||
# scene.objects['Book-cmd'].suspendPhysics()
|
||||
# scene.objects['Book-cmd-Hl'].setVisible(False,False)
|
||||
# scene.objects['Construc'].setVisible(False,False)
|
||||
# scene.objects['Construc'].suspendPhysics()
|
||||
# scene.objects['Construc-Hl'].setVisible(False,False)
|
||||
# scene.objects['Book-cmd-underlay'].setVisible(True,False)
|
||||
|
||||
# Ouvrir la tablette
|
||||
rp_doc.open()
|
||||
|
||||
@ -886,6 +889,7 @@ def tablet_close ():
|
||||
|
||||
def tablet_close_click(cont):
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||
sound_play (snd_close)
|
||||
tablet_close()
|
||||
|
||||
###############################################################################
|
||||
@ -922,12 +926,9 @@ def about_open():
|
||||
##
|
||||
|
||||
def about_open_anim():
|
||||
pas=0.5
|
||||
# scene.objects['About'].localPosition.y -= pas
|
||||
scene.objects['About'].localPosition.y -= 1.09*pas
|
||||
scene.objects['About'].localPosition.z += 0.85*pas
|
||||
# scene.objects['About'].localPosition.y=scene.objects['About'].localPosition.y-1*pas
|
||||
# scene.objects['About'].localPosition.z=scene.objects['About'].localPosition.z+0.85*pas
|
||||
resol=0.5
|
||||
scene.objects['About'].localPosition.y -= 1.09*resol
|
||||
scene.objects['About'].localPosition.z += 0.85*resol
|
||||
scene.objects['About']['timer']+=1
|
||||
if scene.objects['About']['timer']== 40:
|
||||
scene.objects['About']['anim'] = False
|
||||
@ -956,7 +957,6 @@ def about_hl(cont):
|
||||
##
|
||||
|
||||
def about_close():
|
||||
# sound_play (sndbuff_click)
|
||||
scene.objects['Terrain']['manip_mode']=0
|
||||
scene.objects['About'].setVisible(False,True)
|
||||
scene.objects['About'].worldPosition = [42, -2, 3]
|
||||
@ -968,6 +968,7 @@ def about_close():
|
||||
|
||||
def about_close_click(cont):
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||
sound_play (snd_close)
|
||||
about_close()
|
||||
|
||||
##
|
||||
@ -986,6 +987,7 @@ def about_link(cont):
|
||||
'About_link-kenney' : 'https://www.kenney.nl',
|
||||
'About_link-polygonrunway' : 'https://www.patreon.com/polygonrunway/',
|
||||
'About_link-icons' : 'https://game-icons.net/'}
|
||||
sound_play (snd_click)
|
||||
webbrowser.open(link [name])
|
||||
|
||||
# FIXME: souris graphique trop compliqué
|
||||
|
@ -22,7 +22,7 @@ def stop():
|
||||
thread_cmd_stop()
|
||||
|
||||
def end():
|
||||
ct_sleep (2)
|
||||
rp_sleep (2)
|
||||
print ("Thread commands is arrived.")
|
||||
scene.objects['Terrain']['thread_cmd']=False
|
||||
|
||||
@ -41,6 +41,8 @@ def commands():
|
||||
rp_gauche()
|
||||
rp_avancer()
|
||||
|
||||
end()
|
||||
|
||||
###############################################################################
|
||||
# En: Externals calls << DONT CHANGE THIS SECTION >>
|
||||
# Fr: Appels externes << NE PAS MODIFIER CETTE SECTION >>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<data>
|
||||
<config>
|
||||
<speed>0.25</speed>
|
||||
<speed>2.0</speed>
|
||||
<sound>True</sound>
|
||||
<mission_current>2</mission_current>
|
||||
<mission_current>3</mission_current>
|
||||
<mission_success>1</mission_success>
|
||||
</config>
|
||||
</data>
|
92
rp_doc.py
92
rp_doc.py
@ -200,12 +200,12 @@ def init():
|
||||
scene.objects[missions_card[i]].color = color_doc_fct
|
||||
scene.objects[missions_card[i]+"-icon"].color = color_doc_fct
|
||||
scene.objects[missions_card[i]+"-text"].color = color_doc_fct
|
||||
scene.objects[missions_card[i][:-5]+"-current"].color = color_doc_mission
|
||||
scene.objects[missions_card[i][:-5]+"-current-icon"].color = color_doc_mission
|
||||
scene.objects[missions_card[i][:-5]+"-current-text"].color = color_doc_mission
|
||||
scene.objects[missions_card[i][:-5]+"-current"].setVisible(False,True)
|
||||
scene.objects[missions_card[i][:-5]+"-current-icon"].setVisible(False,True)
|
||||
scene.objects[missions_card[i][:-5]+"-current-text"].setVisible(False,True)
|
||||
# scene.objects[missions_card[i][:-5]+"-current"].color = color_doc_mission
|
||||
# scene.objects[missions_card[i][:-5]+"-current-icon"].color = color_doc_mission
|
||||
# scene.objects[missions_card[i][:-5]+"-current-text"].color = color_doc_mission
|
||||
# scene.objects[missions_card[i][:-5]+"-current"].setVisible(False,True)
|
||||
# scene.objects[missions_card[i][:-5]+"-current-icon"].setVisible(False,True)
|
||||
# scene.objects[missions_card[i][:-5]+"-current-text"].setVisible(False,True)
|
||||
for i in range(len(rover_card)):
|
||||
scene.objects[rover_card[i]].color = color_doc_fct
|
||||
scene.objects[rover_card[i]+"-icon"].color = color_doc_fct
|
||||
@ -238,7 +238,6 @@ def open():
|
||||
scene.objects['Doc'].setVisible(True,True)
|
||||
scene.objects['Doc_title'].setVisible(False,True)
|
||||
scene.objects['Doc_text'].setVisible(False,True)
|
||||
# sound_play (sndbuff_book_open)
|
||||
|
||||
# Placer le nouveau chapitre
|
||||
name_chap = scene.objects['Doc']['page_chap']
|
||||
@ -249,17 +248,9 @@ def open():
|
||||
|
||||
# Placer la carte de la mission active
|
||||
if name_chap == "missions":
|
||||
for i in range(len(missions_card)):
|
||||
scene.objects[missions_card[i][:-5]+"-current"].setVisible(False,False)
|
||||
scene.objects[missions_card[i][:-5]+"-current-icon"].setVisible(False,False)
|
||||
scene.objects[missions_card[i][:-5]+"-current-text"].setVisible(False,False)
|
||||
print("mission_+"+str(scene.objects['Terrain']['mission_current'])+"-card")
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-card"].setVisible(False,False)
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-card-icon"].setVisible(False,False)
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-card-icon"].setVisible(False,False)
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-current"].setVisible(True,False)
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-current-icon"].setVisible(True,False)
|
||||
scene.objects["mission_+"+str(scene.objects['Terrain']['mission_current'])+"-current-icon"].setVisible(True,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card"].color = color_doc_mission
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-icon"].color = color_doc_mission
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-text"].color = color_doc_mission
|
||||
|
||||
# Afficher le texte de la carte active
|
||||
if name_chap != "general":
|
||||
@ -321,18 +312,10 @@ def hl (cont):
|
||||
scene.objects[name].color = color_doc_activate
|
||||
scene.objects[name_text].color = color_doc_activate
|
||||
scene.objects[name_icon].color = color_doc_activate
|
||||
if name_chap == "missions":
|
||||
scene.objects[name[:-5]+"-current"].color = color_doc_activate
|
||||
scene.objects[name[:-5]+"-current-icon"].color = color_doc_activate
|
||||
scene.objects[name[:-5]+"-current-text"].color = color_doc_activate
|
||||
else:
|
||||
scene.objects[name].color = color_doc_hl
|
||||
scene.objects[name_text].color = color_doc_hl
|
||||
scene.objects[name_icon].color = color_doc_hl
|
||||
if name_chap == "missions":
|
||||
scene.objects[name[:-5]+"-current"].color = color_doc_hl
|
||||
scene.objects[name[:-5]+"-current-icon"].color = color_doc_hl
|
||||
scene.objects[name[:-5]+"-current-text"].color = color_doc_hl
|
||||
|
||||
# Désactivation
|
||||
if cont.sensors['MO'].status == JUST_RELEASED :
|
||||
@ -358,19 +341,15 @@ def hl (cont):
|
||||
scene.objects[name].color = color_doc_activate
|
||||
scene.objects[name_text].color = color_doc_activate
|
||||
scene.objects[name_icon].color = color_doc_activate
|
||||
if name_chap == "missions":
|
||||
scene.objects[name[:-5]+"-current"].color = color_doc_activate
|
||||
scene.objects[name[:-5]+"-current-icon"].color = color_doc_activate
|
||||
scene.objects[name[:-5]+"-current-text"].color = color_doc_activate
|
||||
else:
|
||||
scene.objects[name].color = color_doc_fct
|
||||
scene.objects[name_text].color = color_doc_fct
|
||||
scene.objects[name_icon].color = color_doc_fct
|
||||
if name_chap == "missions":
|
||||
scene.objects[name[:-5]+"-current"].color = color_doc_mission
|
||||
scene.objects[name[:-5]+"-current-icon"].color = color_doc_mission
|
||||
scene.objects[name[:-5]+"-current-text"].color = color_doc_mission
|
||||
|
||||
if name == "mission_"+str(scene.objects['Terrain']['mission_current'])+"-card":
|
||||
scene.objects[name].color = color_doc_mission
|
||||
scene.objects[name_text].color = color_doc_mission
|
||||
scene.objects[name_icon].color = color_doc_mission
|
||||
else:
|
||||
scene.objects[name].color = color_doc_fct
|
||||
scene.objects[name_text].color = color_doc_fct
|
||||
scene.objects[name_icon].color = color_doc_fct
|
||||
|
||||
##
|
||||
# Afficher le chapitre
|
||||
@ -398,16 +377,9 @@ def chapter(cont):
|
||||
|
||||
# Placer la carte de la mission active
|
||||
if name_chap == "missions":
|
||||
for i in range(len(missions_card)):
|
||||
scene.objects[missions_card[i][:-5]+"-current"].setVisible(False,False)
|
||||
scene.objects[missions_card[i][:-5]+"-current-icon"].setVisible(False,False)
|
||||
scene.objects[missions_card[i][:-5]+"-current-text"].setVisible(False,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card"].setVisible(False,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-icon"].setVisible(False,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-text"].setVisible(False,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-current"].setVisible(True,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-current-icon"].setVisible(True,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-current-text"].setVisible(True,False)
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card"].color = color_doc_mission
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-icon"].color = color_doc_mission
|
||||
scene.objects["mission_"+str(scene.objects['Terrain']['mission_current'])+"-card-text"].color = color_doc_mission
|
||||
|
||||
# Afficher le texte de la carte active
|
||||
if name_chap != "general":
|
||||
@ -438,13 +410,16 @@ def card (cont):
|
||||
|
||||
# Enlever l'ancienne carte
|
||||
if scene.objects['Doc_chap-'+name_chap]['page_fct'] !="":
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']].color = color_doc_fct
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-text'].color = color_doc_fct
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-icon'].color = color_doc_fct
|
||||
if name_chap == "missions":
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct'][:-5]+"-current"].color = color_doc_mission
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct'][:-5]+"-current-icon"].color = color_doc_mission
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct'][:-5]+"-current-text"].color = color_doc_mission
|
||||
|
||||
# Placer la carte de la mission active
|
||||
if scene.objects['Doc_chap-'+name_chap]['page_fct'] == "mission_"+str(scene.objects['Terrain']['mission_current'])+"-card":
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']].color = color_doc_mission
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-text'].color = color_doc_mission
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-icon'].color = color_doc_mission
|
||||
else:
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']].color = color_doc_fct
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-text'].color = color_doc_fct
|
||||
scene.objects[scene.objects['Doc_chap-'+name_chap]['page_fct']+'-icon'].color = color_doc_fct
|
||||
|
||||
# Afficher le texte de la carte
|
||||
scene.objects['Doc_chap-'+name_chap]['page_fct'] = name_fct
|
||||
@ -456,13 +431,6 @@ def card (cont):
|
||||
scene.objects['Doc_title'].setVisible(True, False)
|
||||
scene.objects['Doc_text'].setVisible(True, False)
|
||||
|
||||
# Placer la carte de la mission active
|
||||
if name_chap == "missions":
|
||||
scene.objects[name_fct[:-5]+"-current"].color = color_doc_activate
|
||||
scene.objects[name_fct[:-5]+"-current-icon"].color = color_doc_activate
|
||||
scene.objects[name_fct[:-5]+"-current-text"].color = color_doc_activate
|
||||
|
||||
|
||||
##
|
||||
# Sounds
|
||||
##
|
||||
|
32
rp_lib.py
32
rp_lib.py
@ -708,29 +708,21 @@ def rover_colision ():
|
||||
# scene.objects['Terrain']['scene_tile_noncontruct'].append([math.ceil(x),math.floor(y)])
|
||||
# scene.objects['Terrain']['scene_tile_noncontruct'].append([math.ceil(x),math.ceil(y)])
|
||||
|
||||
# ###############################################################################
|
||||
# # Temporisation
|
||||
# ###############################################################################
|
||||
###############################################################################
|
||||
# Temporisation
|
||||
###############################################################################
|
||||
|
||||
# def ct_sleep (duration):
|
||||
# time.sleep(duration*(1/scene.objects['Terrain']['speed']))
|
||||
def rp_sleep (duration):
|
||||
# time.sleep(duration*(1/scene.objects['Terrain']['speed']))
|
||||
time.sleep(duration)
|
||||
|
||||
# # def ct_tempo (duration):
|
||||
# # scene.objects['Terrain']['delay_cmd']=0
|
||||
# # while scene.objects['Terrain']['delay_cmd']<duration*(1/scene.objects['Terrain']['speed']):
|
||||
# # # print("Temporization commands :",scene.objects['Terrain']['delay_cmd'])
|
||||
# # time.sleep(0.001)
|
||||
# # # pass
|
||||
# def ct_tempo (duration):
|
||||
# scene.objects['Terrain']['delay_cmd']=0
|
||||
# while scene.objects['Terrain']['delay_cmd']<duration*(1/scene.objects['Terrain']['speed']):
|
||||
# # print("Temporization commands :",scene.objects['Terrain']['delay_cmd'])
|
||||
# time.sleep(0.001)
|
||||
# # pass
|
||||
|
||||
# # def ct_tempo_wave (duration):
|
||||
# # scene.objects['Terrain']['delay_wave']=0
|
||||
# # while scene.objects['Terrain']['delay_wave']<duration*(1/scene.objects['Terrain']['speed']):
|
||||
# # # print("Temporization waves :",scene.objects['Terrain']['delay_wave'])
|
||||
# # time.sleep(0.001)
|
||||
# # # pass
|
||||
|
||||
# # def ct_tempo_wave_trigger (duree):
|
||||
# # print ("delay wave ", scene.objects['Terrain']['delay_wave'])
|
||||
|
||||
# ###############################################################################
|
||||
# # Affichage
|
||||
|
@ -36,8 +36,8 @@ def map_init():
|
||||
# filename=object_name)
|
||||
|
||||
# Rover
|
||||
obj=scene.objects['Rover']
|
||||
applyRotationTo(obj, None, None, 0.0, True)
|
||||
# obj=scene.objects['Rover']
|
||||
# applyRotationTo(obj, None, None, 0.0, True)
|
||||
|
||||
# Reset counters
|
||||
def map_reset():
|
||||
|
Loading…
x
Reference in New Issue
Block a user