mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Fichier carte et bugfix sur le fichier de configuration XML
This commit is contained in:
parent
553a7869c5
commit
ee675cc24a
26
#rp_config.xml#
Normal file
26
#rp_config.xml#
Normal file
@ -0,0 +1,26 @@
|
||||
<data>
|
||||
<config>
|
||||
<speed>1.0</speed>
|
||||
<sound>False</sound>
|
||||
<cam>
|
||||
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
||||
<worldPosition.y>-28.759992599487305</worldPosition.y>
|
||||
<worldPosition.z>22.169612884521484</worldPosition.z>
|
||||
</cam>
|
||||
<screen>
|
||||
<width>1599</width>
|
||||
<height>900</height>
|
||||
<quality>4</quality>
|
||||
</screen>
|
||||
</config>
|
||||
<mission>
|
||||
<current>1</current>
|
||||
<level>2</level>
|
||||
</mission>
|
||||
<upgrade>
|
||||
<battery>False</battery>
|
||||
<beacon>False</beacon>
|
||||
<paint>False</paint>
|
||||
<speed>True</speed>
|
||||
</upgrade>
|
||||
</data>
|
Binary file not shown.
BIN
ropy-34.blend
BIN
ropy-34.blend
Binary file not shown.
66
rp.py
66
rp.py
@ -23,7 +23,7 @@ import rp_about # About
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2020-2023 Philippe Roy
|
||||
# @copyright: Copyright (C) 2020-2024 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
#
|
||||
# Ropy est destiné à la découverte de la programmation procédurale et du language Python.
|
||||
@ -37,6 +37,7 @@ import rp_about # About
|
||||
|
||||
# UPBGE scene
|
||||
scene = bge.logic.getCurrentScene()
|
||||
debug = scene.objects['Terrain']['debug']
|
||||
eevee = bpy.context.scene.eevee
|
||||
scene.objects['Commands']['script'] = os.path.join(os.getcwd(), "rp_cmd.py") # Script par défaut
|
||||
|
||||
@ -248,8 +249,8 @@ def terrain_run ():
|
||||
scene.objects['Run'].setVisible(False,False)
|
||||
scene.objects['Run'].suspendPhysics()
|
||||
scene.objects['Run-Hl'].setVisible(False,False)
|
||||
# scene.objects['Pause']. restorePhysics() # FIXME pause pas implémenté
|
||||
# scene.objects['Pause'].setVisible(True,False) # FIXME pause pas implémenté
|
||||
# scene.objects['Pause']. restorePhysics() # FIXME pause pas implémentée
|
||||
# scene.objects['Pause'].setVisible(True,False) # FIXME pause pas implémentée
|
||||
|
||||
# Démarrage de la map
|
||||
if scene.objects['Terrain']['thread_cmd']==False:
|
||||
@ -258,6 +259,9 @@ def terrain_run ():
|
||||
rp_map.map_reset()
|
||||
time.sleep(0.125)
|
||||
|
||||
# Sauvegarde de la config
|
||||
config_save()
|
||||
|
||||
# Nombre de ligne du script Python
|
||||
file = open(scene.objects['Commands']['script'], 'r')
|
||||
file_txt = file.read()
|
||||
@ -1276,6 +1280,7 @@ def store_open ():
|
||||
def store_close():
|
||||
rp_store.close()
|
||||
scene.objects['Terrain']['manip_mode']=0 # Enlever la fenêtre modale
|
||||
|
||||
# Maj du fichier de config (upgrade : data/upgrade/i -> [2][i].text)
|
||||
upgrade_card=("battery", "beacon", "paint", "speed")
|
||||
for i in range(len(upgrade_card)):
|
||||
@ -1391,35 +1396,65 @@ def config_save():
|
||||
##
|
||||
|
||||
def config_load():
|
||||
|
||||
# Lecture du nouveau fichier
|
||||
fichier_xml=os.path.join(os.path.split((scene.objects['Commands']['script']))[0], "rp_config.xml")
|
||||
if os.path.exists(fichier_xml) ==False:
|
||||
return
|
||||
rp_config2 = ET.parse(fichier_xml)
|
||||
rp_config_tree2 = rp_config2.getroot()
|
||||
|
||||
# Réécriture de la configuration courante (trois niveaux) avec le nouveau fichier
|
||||
for i in range (len (rp_config_tree)):
|
||||
if debug:
|
||||
print ("XML config : i, tag : ", i, rp_config_tree2[i].tag)
|
||||
child_flag_i=False
|
||||
for child_i in rp_config_tree[i]:
|
||||
child_flag_i=True
|
||||
if child_flag_i:
|
||||
for j in range (len (rp_config_tree[i])):
|
||||
child_flag_j=False
|
||||
for child_j in rp_config_tree[i][j]:
|
||||
child_flag_j=True
|
||||
if child_flag_j:
|
||||
if debug:
|
||||
print ("XML config : i, j, tag : ", i, j, rp_config_tree2[i][j].tag)
|
||||
for k in range (len (rp_config_tree[i][j])):
|
||||
rp_config_tree[i][j][k].text=rp_config_tree2[i][j][k].text
|
||||
if debug:
|
||||
print ("XML config : i, j, k, tag, text : ", i, j, k, rp_config_tree2[i][j][k].tag, rp_config_tree2[i][j][k].text)
|
||||
else:
|
||||
rp_config_tree[i][j].text=rp_config_tree2[i][j].text
|
||||
if debug:
|
||||
print ("XML config : i, j, tag, text : ", i, j, rp_config_tree2[i][j].tag, rp_config_tree2[i][j].text)
|
||||
else:
|
||||
rp_config_tree[i].text=rp_config_tree2[i].text
|
||||
if debug:
|
||||
print ("XML config : i, tag, text : ", i, rp_config_tree2[i].tag, rp_config_tree2[i].text)
|
||||
|
||||
# Configuration de l'écran
|
||||
bge.render.setWindowSize(int(rp_config_tree2[0][3][0].text),int(rp_config_tree2[0][3][1].text))
|
||||
scene.objects['About']['quality'] = int(rp_config_tree2[0][3][2].text)
|
||||
bge.render.setWindowSize(int(rp_config_tree[0][3][0].text),int(rp_config_tree[0][3][1].text))
|
||||
scene.objects['About']['quality'] = int(rp_config_tree[0][3][2].text)
|
||||
rp_about.quality_apply(scene.objects['About']['quality'])
|
||||
|
||||
# Init de la carte
|
||||
# Read config (mission actuelle : data/mission/current -> [1][0].text)
|
||||
scene.objects['Points']['mission']=int(rp_config_tree2[1][0].text)
|
||||
scene.objects['Points']['mission']=int(rp_config_tree[1][0].text)
|
||||
rp_map.map_init()
|
||||
scene.objects['Terrain']['thread_cmd']=False
|
||||
rp_map.map_reset()
|
||||
|
||||
# Récupération de la position de la caméra
|
||||
scene.objects['Camera']['current_lx'] = float(rp_config_tree2[0][2][0].text)
|
||||
scene.objects['Camera']['current_ly'] = float(rp_config_tree2[0][2][1].text)
|
||||
scene.objects['Camera']['current_lz'] = float(rp_config_tree2[0][2][2].text)
|
||||
scene.objects['Camera']['current_lx'] = float(rp_config_tree[0][2][0].text)
|
||||
scene.objects['Camera']['current_ly'] = float(rp_config_tree[0][2][1].text)
|
||||
scene.objects['Camera']['current_lz'] = float(rp_config_tree[0][2][2].text)
|
||||
scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx']
|
||||
scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
|
||||
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
|
||||
|
||||
# UI : Sounds
|
||||
# Read config (sound : data/config/sound -> [0][1].text)
|
||||
if rp_config_tree2[0][1].text == "True":
|
||||
if rp_config_tree[0][1].text == "True":
|
||||
sound_set ()
|
||||
else:
|
||||
sound_unset ()
|
||||
@ -1428,18 +1463,21 @@ def config_load():
|
||||
# Missions
|
||||
# Read config (mission actuelle : data/mission/current -> [1][0].text)
|
||||
# Read config (niveau atteint : data/mission/level -> [1][1].text)
|
||||
scene.objects['Points']['mission']=int(rp_config_tree2[1][0].text)
|
||||
scene.objects['Points']['mission']=int(rp_config_tree[1][0].text)
|
||||
scene.objects['Points']['mission_init']= scene.objects['Points']['mission']
|
||||
scene.objects['Points']['level']=int(rp_config_tree2[1][1].text)
|
||||
scene.objects['Points']['level']=int(rp_config_tree[1][1].text)
|
||||
scene.objects['Points-Map-text']['Text']="Mission "+str(scene.objects['Points']['mission'])
|
||||
scene.objects['Book_mission']['Text'] = "Mission en cours : "+str(scene.objects['Points']['mission'])
|
||||
scene.objects['Book_level']['Text'] = "Niveau actuel : "+str(scene.objects['Points']['level'])
|
||||
rp_map.task()
|
||||
if scene.objects['Grid-u'].visible:
|
||||
rp_map.aim_show()
|
||||
|
||||
# Upgrade
|
||||
upgrade_card=("battery", "beacon", "paint", "speed")
|
||||
scene.objects['Points']['upgrade_nb'] =0
|
||||
for i in range(len(upgrade_card)):
|
||||
if rp_config_tree2[2][i].text == "True":
|
||||
if rp_config_tree[2][i].text == "True":
|
||||
scene.objects['Points']['upgrade_'+upgrade_card[i]]=True
|
||||
scene.objects['Points']['upgrade_nb'] +=1
|
||||
scene.objects["Store-"+upgrade_card[i]+"-card"]['upgraded'] = True
|
||||
@ -1454,7 +1492,7 @@ def config_load():
|
||||
speed_mode=[0.25, 0.5, 1,2,4,10]
|
||||
speed_mode_txt=["1/4", "1/2", "1", "2","4","10"]
|
||||
if scene.objects['Points']['upgrade_speed'] :
|
||||
scene.objects['Commands']['speed']=float(rp_config_tree2[0][0].text)
|
||||
scene.objects['Commands']['speed']=float(rp_config_tree[0][0].text)
|
||||
else:
|
||||
scene.objects['Commands']['speed']=1.00
|
||||
i=speed_mode.index(scene.objects['Commands']['speed'])
|
||||
|
31
rp_about.py
31
rp_about.py
@ -9,7 +9,7 @@ import webbrowser
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2022-2023 Philippe Roy
|
||||
# @copyright: Copyright (C) 2022-2024 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
###############################################################################
|
||||
|
||||
@ -230,7 +230,6 @@ def credits_close(cont):
|
||||
scene.objects["About"].worldPosition.z = scene.objects["About"]['init_lz']
|
||||
scene.objects['Credits'].setVisible(False,True)
|
||||
scene.objects['About'].setVisible(True,True)
|
||||
print ("ici") # FIXME le About ne revient pas ?
|
||||
|
||||
# Overlay
|
||||
scene.objects['Points'].setVisible(True,True)
|
||||
@ -285,10 +284,10 @@ def credits_close(cont):
|
||||
scene.objects['Speed_down'].setVisible(False,True)
|
||||
scene.objects['Speed_up'].setVisible(False,True)
|
||||
|
||||
# Camera
|
||||
scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx']
|
||||
scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
|
||||
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
|
||||
# # Camera
|
||||
# scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx']
|
||||
# scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
|
||||
# scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
|
||||
|
||||
def credits_link(cont):
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||
@ -426,8 +425,8 @@ def quality_apply(quality, start_flag=False):
|
||||
eevee.use_volumetric_shadows = False
|
||||
eevee.shadow_cascade_size='64'
|
||||
eevee.shadow_cube_size='64'
|
||||
scene.objects['terrain-scatter.001'].setVisible(False,True)
|
||||
scene.objects['terrain-scatter.002'].setVisible(False,True)
|
||||
# scene.objects['terrain-scatter.001'].setVisible(False,True)
|
||||
# scene.objects['terrain-scatter.002'].setVisible(False,True)
|
||||
|
||||
# Basse
|
||||
if quality== 1:
|
||||
@ -442,8 +441,8 @@ def quality_apply(quality, start_flag=False):
|
||||
eevee.use_volumetric_shadows = False
|
||||
eevee.shadow_cascade_size='1024'
|
||||
eevee.shadow_cube_size='512'
|
||||
scene.objects['terrain-scatter.001'].setVisible(False,True)
|
||||
scene.objects['terrain-scatter.002'].setVisible(False,True)
|
||||
# scene.objects['terrain-scatter.001'].setVisible(False,True)
|
||||
# scene.objects['terrain-scatter.002'].setVisible(False,True)
|
||||
|
||||
# Moyenne
|
||||
if quality== 2:
|
||||
@ -458,8 +457,8 @@ def quality_apply(quality, start_flag=False):
|
||||
eevee.use_volumetric_shadows = False
|
||||
eevee.shadow_cascade_size='1024'
|
||||
eevee.shadow_cube_size='512'
|
||||
scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
|
||||
# Haute
|
||||
if quality== 3:
|
||||
@ -474,8 +473,8 @@ def quality_apply(quality, start_flag=False):
|
||||
eevee.use_volumetric_shadows = False
|
||||
eevee.shadow_cascade_size='1024'
|
||||
eevee.shadow_cube_size='512'
|
||||
scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
|
||||
# Épique
|
||||
if quality== 4:
|
||||
@ -490,5 +489,5 @@ def quality_apply(quality, start_flag=False):
|
||||
eevee.use_volumetric_shadows = True
|
||||
eevee.shadow_cascade_size='4096'
|
||||
eevee.shadow_cube_size='4096'
|
||||
scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.001'].setVisible(True,True)
|
||||
# scene.objects['terrain-scatter.002'].setVisible(True,True)
|
||||
|
@ -1,4 +1,5 @@
|
||||
import time
|
||||
import inspect
|
||||
from rp_lib import * # Bibliothèque Ropy
|
||||
|
||||
###############################################################################
|
||||
@ -27,6 +28,8 @@ from rp_lib import * # Bibliothèque Ropy
|
||||
|
||||
def commandes():
|
||||
|
||||
# print ("inspect :", inspect.isfunction(mrp_avancer()))
|
||||
|
||||
print ('okok')
|
||||
rp_gauche()
|
||||
rp_avancer()
|
||||
|
@ -1,11 +1,11 @@
|
||||
<data>
|
||||
<config>
|
||||
<speed>0.25</speed>
|
||||
<speed>1.0</speed>
|
||||
<sound>False</sound>
|
||||
<cam>
|
||||
<worldPosition.x>-9.421216011047363</worldPosition.x>
|
||||
<worldPosition.y>-7.438669204711914</worldPosition.y>
|
||||
<worldPosition.z>9.524099349975586</worldPosition.z>
|
||||
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
||||
<worldPosition.y>-26.440298080444336</worldPosition.y>
|
||||
<worldPosition.z>20.22315788269043</worldPosition.z>
|
||||
</cam>
|
||||
<screen>
|
||||
<width>1599</width>
|
||||
@ -14,8 +14,8 @@
|
||||
</screen>
|
||||
</config>
|
||||
<mission>
|
||||
<current>1</current>
|
||||
<level>1</level>
|
||||
<current>6</current>
|
||||
<level>6</level>
|
||||
</mission>
|
||||
<upgrade>
|
||||
<battery>False</battery>
|
||||
|
42
rp_lib.py
42
rp_lib.py
@ -19,7 +19,7 @@ import rp_map1 as rp_map # Map definition
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2020-2023 Philippe Roy
|
||||
# @copyright: Copyright (C) 2020-2024 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
#
|
||||
# Bibliothèque des actions du robot
|
||||
@ -29,7 +29,7 @@ import rp_map1 as rp_map # Map definition
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
debug_mvt = scene.objects['Terrain']['debug_mvt']
|
||||
debug = scene.objects['Terrain']['debug']
|
||||
|
||||
# Sounds
|
||||
audiodev = aud.Device()
|
||||
@ -212,7 +212,7 @@ def rp_avancer (twins=True):
|
||||
return False
|
||||
|
||||
# Points, console et jumeau numérique
|
||||
if debug_mvt:
|
||||
if debug:
|
||||
print ("rp_avancer()")
|
||||
scene.objects['Points']['step'] +=1
|
||||
if scene.objects['Commands']['twins'] and twins:
|
||||
@ -335,7 +335,7 @@ def rp_reculer (twins=True):
|
||||
return False
|
||||
|
||||
# Points, console et jumeau numérique
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_reculer()")
|
||||
scene.objects['Points']['step'] +=1
|
||||
if scene.objects['Commands']['twins'] and twins:
|
||||
@ -405,7 +405,7 @@ def rp_gauche (twins=True):
|
||||
return False
|
||||
|
||||
# Points, console et jumeau numérique
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_gauche()")
|
||||
scene.objects['Points']['step'] +=1
|
||||
step=math.pi/2 # Pas angulaire
|
||||
@ -456,7 +456,7 @@ def rp_droite (twins=True):
|
||||
return False
|
||||
|
||||
# Points, console et jumeau numérique
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_droite()")
|
||||
scene.objects['Points']['step'] +=1
|
||||
step=math.pi/2 # Pas angulaire
|
||||
@ -516,7 +516,7 @@ def rp_marquer (twins=True):
|
||||
return False
|
||||
|
||||
# Points, console et jumeau numérique
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_marquer() -> balise #"+ str(len(scene.objects['Terrain']['map_tile_beacon'])))
|
||||
if scene.objects['Commands']['twins'] and twins:
|
||||
serial_msg = "MA\n"
|
||||
@ -555,7 +555,7 @@ def rp_detect ():
|
||||
return True
|
||||
|
||||
# Points et console
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_detect")
|
||||
|
||||
# Détection
|
||||
@ -575,21 +575,21 @@ def rp_detect ():
|
||||
x1 = x0-1
|
||||
y1 = y0
|
||||
if [x1,y1] in scene.objects['Terrain']['map_tile_montain']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Présence de montage devant !")
|
||||
if scene.objects['Points']['mission']==3: # Contrôle objectif mission 3
|
||||
rover_goal ()
|
||||
return True
|
||||
|
||||
if [x1,y1] in scene.objects['Terrain']['map_tile_station']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Présence de la station devant !")
|
||||
if scene.objects['Points']['mission']==3: # Contrôle objectif mission 3
|
||||
rover_goal ()
|
||||
return True
|
||||
|
||||
if [x1,y1] in scene.objects['Terrain']['map_tile_station']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Sortie de carte devant !")
|
||||
if scene.objects['Points']['mission']==3: # Contrôle objectif mission 3
|
||||
rover_goal ()
|
||||
@ -608,7 +608,7 @@ def rp_prendre ():
|
||||
return False
|
||||
|
||||
# Points et console
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_prendre")
|
||||
# FIXME
|
||||
|
||||
@ -624,7 +624,7 @@ def rp_radar ():
|
||||
return False
|
||||
|
||||
# Points et console
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("rp_radar")
|
||||
# FIXME
|
||||
|
||||
@ -684,7 +684,7 @@ paint_part.update({"Station cube 2" : [[ 'St-Cubes','St-Cube2','St-Cube3', 'St-C
|
||||
# Mise en couleur
|
||||
def rp_couleur (group_part, new_color):
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Nouvelle couleur :", str(new_color),"->", group_part)
|
||||
if "Balise" not in group_part :
|
||||
for i in range (len(paint_part[group_part][0])):
|
||||
@ -702,7 +702,7 @@ def rp_couleur (group_part, new_color):
|
||||
|
||||
def rp_couleur_detail (part, new_color):
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Nouvelle couleur :", str(new_color),"->", part)
|
||||
scene.objects[part].color = new_color
|
||||
|
||||
@ -710,7 +710,7 @@ def rp_couleur_detail (part, new_color):
|
||||
def rp_couleur_init (group_part=None):
|
||||
if group_part is not None:
|
||||
if scene.objects['Points']['upgrade_paint']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
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]
|
||||
@ -741,7 +741,7 @@ def rp_couleur_listedetail (element, new_color):
|
||||
def rp_vitesse (new_speed):
|
||||
if scene.objects['Points']['upgrade_speed']:
|
||||
if new_speed is not None:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Nouvelle vitesse :", new_speed)
|
||||
scene.objects['Text_speed']['Text']=str(new_speed)
|
||||
scene.objects['Commands']['speed']=new_speed
|
||||
@ -756,7 +756,7 @@ def rp_balise ():
|
||||
for i in range (200):
|
||||
if scene.objects["Beacon-"+str(i)]['activated']==False:
|
||||
break
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Nombre de balises posées :", i)
|
||||
return i
|
||||
|
||||
@ -766,7 +766,7 @@ def rp_balise ():
|
||||
|
||||
def rp_batterie ():
|
||||
if scene.objects['Points']['upgrade_battery']:
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Charge de la batterie :", scene.objects['Points']['battery'])
|
||||
return scene.objects['Points']['battery']
|
||||
|
||||
@ -904,7 +904,7 @@ def rover_colision_station (back):
|
||||
|
||||
def rover_goal ():
|
||||
obj=scene.objects['Rover']
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Goal !!")
|
||||
obj['stop'] = True
|
||||
|
||||
@ -962,7 +962,7 @@ def rover_goal ():
|
||||
|
||||
def rover_drill (x,y):
|
||||
obj=scene.objects['Rover']
|
||||
if (debug_mvt):
|
||||
if debug:
|
||||
print ("Goal : ", [x,y])
|
||||
|
||||
# Animation
|
||||
|
@ -1,6 +1,7 @@
|
||||
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
||||
import bpy # Blender
|
||||
import random
|
||||
import inspect
|
||||
from rp_lib import * # Bibliothèque Ropy
|
||||
import os
|
||||
|
||||
@ -10,7 +11,7 @@ import os
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2020-2022 Philippe Roy
|
||||
# @copyright: Copyright (C) 2020-2024 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
###############################################################################
|
||||
|
||||
@ -145,7 +146,7 @@ def map_init():
|
||||
# Terrain
|
||||
file_path = 'asset/map/map1.blend'
|
||||
inner_path = 'Object'
|
||||
object_name = 'Terrain'
|
||||
object_name = 'Landscape'
|
||||
bpy.ops.wm.append(
|
||||
filepath=os.path.join(file_path, inner_path, object_name),
|
||||
directory=os.path.join(file_path, inner_path),
|
||||
|
10
rp_store.py
10
rp_store.py
@ -7,7 +7,7 @@ import rp_doc # Documentation
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2022 Philippe Roy
|
||||
# @copyright: Copyright (C) 2022-2024 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
#
|
||||
# Ropy est destiné à la découverte de la programmation procédurale et du language Python.
|
||||
@ -87,7 +87,7 @@ def open2 (cont):
|
||||
scene.objects['Camera'].setVisible(False,True)
|
||||
|
||||
# Animation de la bulle
|
||||
scene.objects['Bubble-1-text']['Text']="Salut mon ami !\n Souhaites tu\n acquerir des\n nouvelles\n ameliorations ?\n"
|
||||
scene.objects['Bubble-1-text']['Text']="Salut mon ami !\n Souhaites tu\n acquerir des\n nouvelles\n améliorations ?\n"
|
||||
if scene.objects['Points']['upgrade_nb'] == 4 :
|
||||
scene.objects['Bubble-1-text']['Text']="Resalut ! \n Rien de neuf \n pour le moment. \n Il fait beau \n aujourd'hui, non ?"
|
||||
if scene.objects['Points']['upgrade_nb'] < 4 and scene.objects['Points']['upgrade_credit']==0:
|
||||
@ -166,9 +166,9 @@ def open_anim():
|
||||
##
|
||||
|
||||
def close ():
|
||||
scene.objects["Store-panel"].worldPosition.x=scene.objects["Store"]['init_lx']
|
||||
scene.objects["Store-panel"].worldPosition.y=scene.objects["Store"]['init_ly']
|
||||
scene.objects["Store-panel"].worldPosition.z=scene.objects["Store"]['init_lz']
|
||||
scene.objects["Store-panel"].worldPosition.x=scene.objects["Store-panel"]['init_lx']
|
||||
scene.objects["Store-panel"].worldPosition.y=scene.objects["Store-panel"]['init_ly']
|
||||
scene.objects["Store-panel"].worldPosition.z=scene.objects["Store-panel"]['init_lz']
|
||||
scene.objects['Store-panel'].setVisible(False,True)
|
||||
scene.objects['Bubble-1'].setVisible(False,True)
|
||||
# scene.objects['Bubble-1-text'].setVisible(False,True)
|
||||
|
Loading…
Reference in New Issue
Block a user