mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Ajout de la config de la taille de l'écran
This commit is contained in:
parent
6b4319a0ce
commit
3510919241
BIN
ropy-28.blend
Normal file
BIN
ropy-28.blend
Normal file
Binary file not shown.
152
rp.py
152
rp.py
@ -3,6 +3,7 @@ import bpy # Blender
|
||||
import aud # Sounds
|
||||
import math
|
||||
import mathutils
|
||||
import numpy as np
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
@ -14,6 +15,7 @@ import runpy
|
||||
import rp_map1 as rp_map # Map definition
|
||||
import rp_doc # Documentation
|
||||
import rp_store # Store
|
||||
import rp_about # About
|
||||
# import ct_cmd # user script (commands)
|
||||
|
||||
###############################################################################
|
||||
@ -32,7 +34,6 @@ import rp_store # Store
|
||||
# Commands trigged by 3D scene objects : scn_*
|
||||
# Commands trigged by user (student or map designer) : rp_*
|
||||
# 3D scene manipulation : manip_*
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# Debug flag
|
||||
@ -132,7 +133,7 @@ def points_maj (cont):
|
||||
##
|
||||
|
||||
def terrain_init ():
|
||||
|
||||
|
||||
# Ajout du Hud
|
||||
scene.active_camera = scene.objects["Camera"]
|
||||
scene.objects['Sun'].setVisible(True,True)
|
||||
@ -197,6 +198,19 @@ def terrain_init ():
|
||||
scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
|
||||
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
|
||||
|
||||
# Camera embarquée
|
||||
# scene.objects['Camera-Rover'].setViewport(100,100,150,150)
|
||||
# scene.objects['Camera-Rover'].useViewport = True
|
||||
|
||||
# width = bge.render.getWindowWidth()
|
||||
# height = bge.render.getWindowHeight()
|
||||
# cam1 = scene.objects["Camera"]
|
||||
# cam2 = scene.objects["Camera-Rover"]
|
||||
# cam1.useViewport = True
|
||||
# cam2.useViewport = True
|
||||
# cam1.setViewport(0, 0, int(width / 2), height)
|
||||
# cam2.setViewport(int(width / 2), 0, width, height)
|
||||
|
||||
##
|
||||
# Mise en route et pause du cycle
|
||||
##
|
||||
@ -378,6 +392,10 @@ color_cmd_hl = (0.8, 0.619, 0.021, 1) # Jaune
|
||||
|
||||
def cmd_init():
|
||||
|
||||
# Taille de la fenêtre
|
||||
# Read config (screen size : data/config/screen/width-> [0][3][0].text)
|
||||
bge.render.setWindowSize(int(rp_config_tree[0][3][0].text),int(rp_config_tree[0][3][1].text))
|
||||
|
||||
# UI : Commands
|
||||
scene.objects['Run-Hl'].setVisible(False,False)
|
||||
scene.objects['Pause'].setVisible(False,False)
|
||||
@ -470,7 +488,7 @@ def cmd_hl(cont):
|
||||
|
||||
# Activation
|
||||
if cont.sensors['MO'].status == JUST_ACTIVATED and scene.objects['Terrain']['manip_mode']==0:
|
||||
if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop":
|
||||
if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop" and obj.name!="Doc-cmd-colbox":
|
||||
obj.setVisible(False,True)
|
||||
scene.objects[obj.name+'-Hl'].setVisible(True,True)
|
||||
|
||||
@ -489,13 +507,18 @@ def cmd_hl(cont):
|
||||
scene.objects['Stop'].setVisible(False,False)
|
||||
scene.objects['Stop-Hl'].setVisible(True,False)
|
||||
|
||||
# Doc
|
||||
if obj.name=="Doc-cmd-colbox":
|
||||
scene.objects['Doc-cmd'].setVisible(False,False)
|
||||
scene.objects['Doc-cmd-Hl'].setVisible(True,False)
|
||||
|
||||
# Text
|
||||
text_hl ={"Run":"Exécuter (F5)",
|
||||
"Stop":"Stop et initialisation (F6)",
|
||||
"Pause":"Pause (F5)",
|
||||
"Aim-cmd":"Afficher/cacher l'objectif",
|
||||
"Doc-cmd":"Documentation",
|
||||
"Store-cmd":"Magasin",
|
||||
"Doc-cmd-colbox":"Documentation",
|
||||
"Store-cmd":"Boutique",
|
||||
"Task-cmd":"Liste des tâches",
|
||||
"Task_close-cmd":"Fermer la liste des tâches",
|
||||
"ResetView": "Reset de la vue (Touche Début)",
|
||||
@ -522,7 +545,7 @@ def cmd_hl(cont):
|
||||
if cont.sensors['MO'].status == JUST_RELEASED and (scene.objects['Terrain']['manip_mode']==0 or scene.objects['Terrain']['manip_mode']==9):
|
||||
scene.objects['Cmd-text']['Text']= ""
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop" and obj.name!="Sound-cmd" and obj.name!="NoSound-cmd" and obj.name!="Task-cmd" and obj.name!="Task_close-cmd" :
|
||||
if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop" and obj.name!="Sound-cmd" and obj.name!="NoSound-cmd" and obj.name!="Task-cmd" and obj.name!="Task_close-cmd" and obj.name!="Doc-cmd-colbox":
|
||||
scene.objects[obj.name+'-Hl'].setVisible(False,True)
|
||||
obj.setVisible(True,True)
|
||||
|
||||
@ -541,6 +564,11 @@ def cmd_hl(cont):
|
||||
scene.objects['Stop-Hl'].setVisible(False,False)
|
||||
scene.objects['Stop'].setVisible(True,False)
|
||||
|
||||
# Doc
|
||||
if obj.name=="Doc-cmd-colbox":
|
||||
scene.objects['Doc-cmd-Hl'].setVisible(False,False)
|
||||
scene.objects['Doc-cmd'].setVisible(True,False)
|
||||
|
||||
# Sound
|
||||
if obj.name=="NoSound-cmd" and scene.objects['Commands']['sound']==False:
|
||||
scene.objects['NoSound-cmd-Hl'].setVisible(False,False)
|
||||
@ -595,8 +623,8 @@ def cmd_click (cont):
|
||||
if obj.name=="NoSound-cmd":
|
||||
sound_set ()
|
||||
sound_play (snd_click)
|
||||
|
||||
if obj.name=="Doc-cmd":
|
||||
|
||||
if obj.name=="Doc-cmd-colbox":
|
||||
sound_play (snd_open)
|
||||
tablet_open ()
|
||||
if obj.name=="About-cmd":
|
||||
@ -1264,7 +1292,6 @@ def store_close():
|
||||
if scene.objects['Store']['Grid_visible']:
|
||||
terrain_grid()
|
||||
|
||||
|
||||
##
|
||||
# Clic pour fermer le store
|
||||
##
|
||||
@ -1278,9 +1305,6 @@ def store_close_click(cont):
|
||||
# About
|
||||
###############################################################################
|
||||
|
||||
color_link = (0, 1, 0.857,1) # Turquoise
|
||||
color_link_hl = (0.799, 0.617, 0.021, 1) # Jaune
|
||||
|
||||
##
|
||||
# Ouvrir le about
|
||||
##
|
||||
@ -1295,52 +1319,8 @@ def about_open():
|
||||
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['init_lz']
|
||||
applyRotationTo(scene.objects['Terrain'], 0, 0, 0)
|
||||
scene.objects['Cmd-text']['Text']= ""
|
||||
|
||||
scene.objects['About_link-git'].color= color_link
|
||||
scene.objects['About_link-gpl'].color= color_link
|
||||
scene.objects['About_link-upbge'].color= color_link
|
||||
scene.objects['About_link-kay'].color= color_link
|
||||
scene.objects['About_link-kenney'].color= color_link
|
||||
scene.objects['About_link-polygonrunway'].color= color_link
|
||||
scene.objects['About_link-icons'].color= color_link
|
||||
scene.objects['About_close'].color= color_link
|
||||
rp_about.open()
|
||||
|
||||
scene.objects['About'].setVisible(True,True)
|
||||
scene.objects['About'].worldPosition = [0, 1.53623, -1.8] # old [0, 1.53623, -0.892838]
|
||||
scene.objects['About']['timer'] = 0
|
||||
scene.objects['About']['anim'] = True
|
||||
|
||||
##
|
||||
# Animation du about
|
||||
##
|
||||
|
||||
def about_open_anim():
|
||||
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
|
||||
|
||||
##
|
||||
# Highlight du about
|
||||
##
|
||||
|
||||
def about_hl(cont):
|
||||
if cont.sensors['MO'].status == JUST_ACTIVATED:
|
||||
# if scene.objects['Mouse_main']['mouse_graphic']:
|
||||
# mouse_up()
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link_hl
|
||||
|
||||
if cont.sensors['MO'].status == JUST_RELEASED:
|
||||
# if scene.objects['Mouse_main']['mouse_graphic']:
|
||||
# mouse_down()
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link
|
||||
|
||||
##
|
||||
# Fermer le about
|
||||
##
|
||||
@ -1363,37 +1343,35 @@ def about_close_click(cont):
|
||||
about_close()
|
||||
|
||||
##
|
||||
# Liens du about
|
||||
# Configuration de l'écran
|
||||
##
|
||||
|
||||
def about_link(cont):
|
||||
def getnearpos(array,value):
|
||||
array = np.asarray(array)
|
||||
idx = (np.abs(array-value)).argmin()
|
||||
return idx
|
||||
|
||||
def about_screen(cont):
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
link={
|
||||
'About_link-git' : 'https://gitlab.com/blender-edutech/ropy',
|
||||
'About_link-gpl' : 'https://www.gnu.org/licenses/gpl-3.0.html',
|
||||
'About_link-upbge' : 'https://www.upbge.org',
|
||||
'About_link-kay' : 'https://www.kaylousberg.com',
|
||||
'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])
|
||||
screen_width_mode=[640, 960, 1280, 1920]
|
||||
screen_height_mode=[360, 540, 720,1080]
|
||||
screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
||||
i = getnearpos(screen_width_mode, bge.render.getWindowWidth())
|
||||
if i>=0 and i<3 :
|
||||
screen_width=screen_width_mode[i+1]
|
||||
screen_height=screen_height_mode[i+1]
|
||||
elif i==3 :
|
||||
screen_width=screen_width_mode[0]
|
||||
screen_height=screen_height_mode[0]
|
||||
else:
|
||||
screen_width=screen_width_mode[1]
|
||||
screen_height=screen_height_mode[1]
|
||||
scene.objects['About_screen']['Text']= "SCREEN SIZE : "+str(screen_width) +" x "+str(screen_height)
|
||||
bge.render.setWindowSize(screen_width,screen_height)
|
||||
|
||||
# FIXME: souris graphique trop compliqué
|
||||
def about_link_hl(cont):
|
||||
decal = 15
|
||||
if cont.sensors['MO'].status == JUST_ACTIVATED :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link_hl
|
||||
# if scene.objects['Mouse_main']['mouse_graphic']:
|
||||
# mouse_up()
|
||||
|
||||
if cont.sensors['MO'].status == JUST_RELEASED :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link
|
||||
# if scene.objects['Mouse_main']['mouse_graphic']:
|
||||
# mouse_down()
|
||||
# Maj du fichier de config (screen size : data/config/screen/width-> [0][3][0].text)
|
||||
rp_config_tree[0][3][0].text=str(screen_width)
|
||||
rp_config_tree[0][3][1].text=str(screen_height)
|
||||
buffer_xml = ET.tostring(rp_config_tree)
|
||||
with open("rp_config.xml", "wb") as f:
|
||||
f.write(buffer_xml)
|
||||
|
103
rp_about.py
Normal file
103
rp_about.py
Normal file
@ -0,0 +1,103 @@
|
||||
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
||||
import webbrowser
|
||||
|
||||
###############################################################################
|
||||
# rp_about.py
|
||||
# @title: A propos pour Ropy
|
||||
# @project: Ropy (Blender-EduTech)
|
||||
# @lang: fr
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2022 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
|
||||
# Colors
|
||||
color_link = (0, 1, 0.857,1) # Turquoise
|
||||
color_link_hl = (0.799, 0.617, 0.021, 1) # Jaune
|
||||
|
||||
# UPBGE constants
|
||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||
JUST_RELEASED = bge.logic.KX_INPUT_JUST_RELEASED
|
||||
ACTIVATE = bge.logic.KX_INPUT_ACTIVE
|
||||
# JUST_DEACTIVATED = bge.logic.KX_SENSOR_JUST_DEACTIVATED
|
||||
|
||||
##
|
||||
# Ouverture
|
||||
##
|
||||
|
||||
def open():
|
||||
scene.objects['About_close'].color= color_link
|
||||
scene.objects['About_screen'].color= color_link
|
||||
scene.objects['About_screen']['Text']= "SCREEN SIZE : "+str(bge.render.getWindowWidth()) +" x "+str(bge.render.getWindowHeight())
|
||||
|
||||
scene.objects['About_link-git'].color= color_link
|
||||
scene.objects['About_link-gpl'].color= color_link
|
||||
scene.objects['About_link-upbge'].color= color_link
|
||||
scene.objects['About_link-kay'].color= color_link
|
||||
scene.objects['About_link-kenney'].color= color_link
|
||||
scene.objects['About_link-polygonrunway'].color= color_link
|
||||
scene.objects['About_link-icons'].color= color_link
|
||||
|
||||
scene.objects['About'].setVisible(True,True)
|
||||
scene.objects['About'].worldPosition = [0, 1.53623, -1.8] # old [0, 1.53623, -0.892838]
|
||||
scene.objects['About']['timer'] = 0
|
||||
scene.objects['About']['anim'] = True
|
||||
|
||||
##
|
||||
# Animation de l'ouverture
|
||||
##
|
||||
|
||||
def open_anim():
|
||||
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
|
||||
|
||||
##
|
||||
# Highlight
|
||||
##
|
||||
|
||||
def hl(cont):
|
||||
if cont.sensors['MO'].status == JUST_ACTIVATED:
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link_hl
|
||||
|
||||
if cont.sensors['MO'].status == JUST_RELEASED:
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link
|
||||
|
||||
##
|
||||
# Liens
|
||||
##
|
||||
|
||||
def link(cont):
|
||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
link={
|
||||
'About_link-git' : 'https://gitlab.com/blender-edutech/ropy',
|
||||
'About_link-gpl' : 'https://www.gnu.org/licenses/gpl-3.0.html',
|
||||
'About_link-upbge' : 'https://www.upbge.org',
|
||||
'About_link-kay' : 'https://www.kaylousberg.com',
|
||||
'About_link-kenney' : 'https://www.kenney.nl',
|
||||
'About_link-polygonrunway' : 'https://www.patreon.com/polygonrunway/',
|
||||
'About_link-icons' : 'https://game-icons.net/'}
|
||||
webbrowser.open(link [name])
|
||||
|
||||
def link_hl(cont):
|
||||
decal = 15
|
||||
if cont.sensors['MO'].status == JUST_ACTIVATED :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link_hl
|
||||
|
||||
if cont.sensors['MO'].status == JUST_RELEASED :
|
||||
obj = cont.owner
|
||||
name=obj.name[:-7]
|
||||
scene.objects[name].color = color_link
|
@ -1,21 +1,25 @@
|
||||
<data>
|
||||
<config>
|
||||
<speed>1.0</speed>
|
||||
<speed>4.0</speed>
|
||||
<sound>False</sound>
|
||||
<cam>
|
||||
<worldPosition.x>11.022780418395996</worldPosition.x>
|
||||
<worldPosition.y>-29.51092529296875</worldPosition.y>
|
||||
<worldPosition.z>32.129486083984375</worldPosition.z>
|
||||
<worldPosition.x>0.0057830810546875</worldPosition.x>
|
||||
<worldPosition.y>-26.440298080444336</worldPosition.y>
|
||||
<worldPosition.z>20.22315788269043</worldPosition.z>
|
||||
</cam>
|
||||
<screen>
|
||||
<width>960</width>
|
||||
<height>540</height>
|
||||
</screen>
|
||||
</config>
|
||||
<mission>
|
||||
<current>6</current>
|
||||
<level>7</level>
|
||||
<current>1</current>
|
||||
<level>1</level>
|
||||
</mission>
|
||||
<upgrade>
|
||||
<battery>True</battery>
|
||||
<beacon>True</beacon>
|
||||
<paint>True</paint>
|
||||
<speed>True</speed>
|
||||
<battery>False</battery>
|
||||
<beacon>False</beacon>
|
||||
<paint>False</paint>
|
||||
<speed>False</speed>
|
||||
</upgrade>
|
||||
</data>
|
13
rp_doc.py
13
rp_doc.py
@ -13,8 +13,6 @@ import webbrowser
|
||||
#
|
||||
# Ropy est destiné à la découverte de la programmation procédurale et du language Python.
|
||||
# A travers plusieurs challenges, donc de manière graduée, les élèves vont apprendre à manipuler les structures algorithmiques de base et à les coder en Python.
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
@ -118,7 +116,7 @@ rp_beacon_title="Balise +"
|
||||
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 dejà posées \n lors du trajet. \n\n\n\n\n\n\n\n"
|
||||
rp_beacon_store="Porte le nombre de \nbalises transportées\nà 200 (contre 20)."
|
||||
rp_beacon_purchased="Les colis viennent \n tout juste d'être \n livrés. Ce terrain\n va devenir un vrai \n sapin de Noël !"
|
||||
rp_beacon_purchased="Les colis viennent \n tout juste d'être \n livrés. Un vrai sapin de Noël, \nce terrain !"
|
||||
rp_beacon_type="upgrade"
|
||||
card_description.update({"beacon-card" : [rp_beacon_title, rp_beacon_text, rp_beacon_store, rp_beacon_purchased, rp_beacon_type]})
|
||||
|
||||
@ -196,14 +194,19 @@ card_description.update({"oop-card" : [rp_oop_title, rp_oop_text, rp_oop_url]})
|
||||
|
||||
# Console
|
||||
rp_console_title="Console"
|
||||
rp_console_text="FIXME"
|
||||
rp_console_text=" Si vous avez executé Ropy dans un \n terminal avec l'option \"-con\", vous \n pouvez utiliser le terminal comme \n console de debuggage.\n\n"
|
||||
rp_console_text= rp_console_text + " print(\"Bonjour !\") \n -> Affiche le texte dans la console.\n\n"
|
||||
rp_console_text= rp_console_text + " variable = input () \n -> Permet la saisie, par exemple : \n"
|
||||
rp_console_text= rp_console_text + " entree = \"\"\n while entree == \"\" :\n entree = input ()"
|
||||
rp_console_url=[["w3schools.com : print","https://www.w3schools.com/python/ref_func_print.asp"],
|
||||
["w3schools.com : input","https://www.w3schools.com/python/ref_func_input.asp"]]
|
||||
card_description.update({"console-card" : [rp_console_title, rp_console_text, rp_console_url]})
|
||||
|
||||
# Temps
|
||||
rp_sleep_title="Gestion du temps"
|
||||
rp_sleep_text="FIXME"
|
||||
rp_sleep_text=" Vous pouvez créer des temporisations \n dans le déroulement du script.\n\n"
|
||||
rp_sleep_text= rp_sleep_text + " time.sleep(x) \n -> Marque d'un temps d'arrêt de \n x secondes.\n\n"
|
||||
rp_sleep_text= rp_sleep_text + " Il faudra préalablement importer la \n bibliothèque \"time\" avec \"import time\". \n\n\n\n\n\n"
|
||||
rp_sleep_url=[["docs.python.org : sleep","https://docs.python.org/fr/3/library/time.html#time.sleep"]]
|
||||
card_description.update({"sleep-card" : [rp_sleep_title, rp_sleep_text, rp_sleep_url]})
|
||||
|
||||
|
@ -24,7 +24,6 @@ import rp_map1 as rp_map # Map definition
|
||||
#
|
||||
# Ropy est destiné à la découverte de la programmation procédurale et du language Python.
|
||||
# A travers plusieurs challenges, donc de manière graduée, les élèves vont apprendre à manipuler les structures algorithmiques de base et à les coder en Python.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
|
@ -12,7 +12,6 @@ import os
|
||||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||||
# @copyright: Copyright (C) 2020-2022 Philippe Roy
|
||||
# @license: GNU GPL
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
@ -108,7 +107,7 @@ missions_task.update({"5" : [mission_5_task]})
|
||||
# Mission 6
|
||||
mission_6_title="Mission 6\n Se rendre utile"
|
||||
mission_6_text="\n \n Une zone du terrain doit être explorée.\n Il faut procéder à des carottages afin \n d'analyser la roche. \n\n"
|
||||
mission_6_text= mission_6_text + "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_text= mission_6_text + " Les lieux de forage (affichés ici en \n permance) sont définis de manière \n 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é -> ramassage de pierre
|
||||
@ -271,6 +270,10 @@ def map_reset():
|
||||
scene.objects['Terrain']['map_aim'].append([x1,y1])
|
||||
scene.objects['Drill_aim-'+str(i)].setVisible(True,True)
|
||||
position_ok=True
|
||||
else:
|
||||
for i in range (10):
|
||||
if scene.objects['Drill_aim-'+str(i)].visible:
|
||||
scene.objects['Drill_aim-'+str(i)].setVisible(False,True)
|
||||
|
||||
###############################################################################
|
||||
# Objectif
|
||||
|
@ -12,7 +12,6 @@ import rp_doc # Documentation
|
||||
#
|
||||
# Ropy est destiné à la découverte de la programmation procédurale et du language Python.
|
||||
# A travers plusieurs challenges, donc de manière graduée, les élèves vont apprendre à manipuler les structures algorithmiques de base et à les coder en Python.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
scene = bge.logic.getCurrentScene()
|
||||
|
Loading…
x
Reference in New Issue
Block a user