diff --git a/asset/map/map1.blend b/asset/map/map1.blend new file mode 100644 index 0000000..1d5bf56 Binary files /dev/null and b/asset/map/map1.blend differ diff --git a/ropy-32.blend b/ropy-32.blend index 6758978..392830c 100644 Binary files a/ropy-32.blend and b/ropy-32.blend differ diff --git a/ropy-33.blend b/ropy-33.blend index ed74f39..b1fa152 100644 Binary files a/ropy-33.blend and b/ropy-33.blend differ diff --git a/ropy-34.blend b/ropy-34.blend new file mode 100644 index 0000000..a1a8c5d Binary files /dev/null and b/ropy-34.blend differ diff --git a/rp.py b/rp.py index 91e0e73..b5cb0f1 100644 --- a/rp.py +++ b/rp.py @@ -689,7 +689,7 @@ def mode(cont): if scene.objects['Doc'].visible: tablet_close() return - if scene.objects['Store'].visible: + if scene.objects['Store-panel'].visible: store_close() return else: # Sortir du jeu @@ -1263,10 +1263,10 @@ def upgrade_maj(): def store_open (): upgrade_maj() if scene.objects['Grid-u'].visible: - scene.objects['Store']['Grid_visible'] = True + scene.objects['Store-panel']['Grid_visible'] = True terrain_grid() else: - scene.objects['Store']['Grid_visible'] = False + scene.objects['Store-panel']['Grid_visible'] = False rp_store.open() ## @@ -1336,7 +1336,7 @@ def store_close(): upgrade_maj() # Affichage de la grille + mission - if scene.objects['Store']['Grid_visible']: + if scene.objects['Store-panel']['Grid_visible']: terrain_grid() ## diff --git a/rp_about.py b/rp_about.py index 0dd7d1e..2e4f2f7 100644 --- a/rp_about.py +++ b/rp_about.py @@ -230,6 +230,7 @@ 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) diff --git a/rp_cmd.py b/rp_cmd.py index 2ff5b25..5384c57 100644 --- a/rp_cmd.py +++ b/rp_cmd.py @@ -32,7 +32,7 @@ def commandes(): rp_avancer() rp_avancer() rp_droite() - for i in range (10): + for i in range (3): rp_avancer() rp_marquer() diff --git a/rp_config.xml b/rp_config.xml index 0976f72..a5dcbd8 100644 --- a/rp_config.xml +++ b/rp_config.xml @@ -1,15 +1,15 @@ - 1.0 + 0.25 False - 2.8847856521606445 - -26.193437576293945 - 20.51732063293457 + -9.421216011047363 + -7.438669204711914 + 9.524099349975586 - 1333 - 749 + 1599 + 900 4 @@ -21,6 +21,6 @@ False False False - False + True \ No newline at end of file diff --git a/rp_map1.py b/rp_map1.py index 9b26732..3c05908 100644 --- a/rp_map1.py +++ b/rp_map1.py @@ -143,12 +143,35 @@ def get_missions_description(): def map_init(): # Terrain + file_path = 'asset/map/map1.blend' + inner_path = 'Object' + object_name = 'Terrain' + bpy.ops.wm.append( + filepath=os.path.join(file_path, inner_path, object_name), + directory=os.path.join(file_path, inner_path), + filename=object_name) + 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]] - for obj_i in scene.objects: - 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)]) + + # Détection des emplacements des colisions de montagne + # scene.objects['Terrain']['map_tile_montain']= [] + # for obj_i in scene.objects: + # 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)]) + scene.objects['Terrain']['map_tile_montain'] = [[-9, -1], [1, -9], [-14, -8], [-12, -10], [-11, -10], [-10, -10], [-9, -10], [-11, 1], [-14, 3], [-14, 4], [-14, -7], [-12, 1], [2, -7], [-12, 10], + [-11,10], [-10, 10], [-9, 10], [-8, 10], [-4, 7], [-2, 6], [4, 10], [5, 10], [1, 8], [2, -6], [6, 10], [7, 10], [8, 10], [9, 10], [10, 10], [11, 10], + [14,7], [-14, -1], [13, 8], [-14, 0], [-14, -2], [8, -1], [-15, -7], [-15, -8], [-15, -9], [-15, -6], [-8, -10], [-7, -10], [10, -1], [15, 5], [11, -1], + [14, 9], [15, 10], [12, -1], [4, -9], [5, -9], [6, -9], [3, -10], [7, -10], [-14, -11], [-6, -11], [3, -11], [7, -11], [0, -11], [0, 1], [-1, 0], [13, 7], + [13, 6], [13, 5], [1, 1], [0, -1], [14, 10], [13, 9], [14, 8], [14, 6], [12, 10], [15, 9], [15, 3], [9, -1], [7, -1], [15, 8], [15, 7], [6, -1], [2, -5], + [2, -4], [2, -3], [2, -2], [5, -1], [4, -1], [3, -1], [3, 10], [-1, 6], [0, -10], [-13, -9], [1, -8], [-12, -3], [-9, -2], [-12, -5], [-13, -6], [-13, 5], + [-13, 6], [-14, 8], [-13, 2], [-10, -3], [-13, 9], [-7, 9], [-14, 7], [-6, 8], [-5, 7], [-3, 6], [0, 6], [1, 7], [2, 9], [-10, 1], [-9, 0], [-15, 2], + [-14,1], [-14, -10], [-14, -5], [-13, -4], [-13, -3], [2, -1], [13, 4], [14, 3], [15, 6], [13, -1], [14, -2], [-6, -10], [15, -3], [14, 5], [3, -9], + [7,-9], [-13, 10], [-13, 10], [15, -4], [15, -4], [14, -3], [14, -3], [-14, 9], [-14, 9], [-14, 6], [-14, 6], [-14, 5], [-14, 5], [-14, 2], [-14, 2], + [-13,1], [-13, 1], [-10, 0], [-10, 0], [-10, -2], [-10, -2], [-11, -3], [-11, -3], [-12, -4], [-12, -4], [-13, -5], [-13, -5], [-14, -6], [-14, -6], + [-14,-9], [-14, -9], [-13, -10], [-13, -10], [-7, 10], [-7, 10], [-6, 9], [-6, 9], [-5, 8], [-5, 8], [-3, 7], [-3, 7], [0, 7], [0, 7], [1, 9], [1, 9], + [2,10], [2, 10], [13, 10], [13, 10], [13, -2], [13, -2], [-15, -10], [-15, -10], [1, -10], [1, -10], [-15, 1], [-15, 1], [-15, -5], [-15, -5], [-14, -4], + [-14, -4], [-14, -3], [-14, -3], [-15, 8], [-15, 8], [14, 4], [14, 4], [-15, 7], [-15, 7], [2, -8], [2, -8]] # Couleurs rp_couleur_init() diff --git a/rp_store.py b/rp_store.py index f563c45..11326a0 100644 --- a/rp_store.py +++ b/rp_store.py @@ -39,17 +39,17 @@ ACTIVATE = bge.logic.KX_INPUT_ACTIVE def init(): # Mémorisation de la position de la tablette du store - scene.objects["Store"]['init_lx']=scene.objects["Store"].worldPosition.x - scene.objects["Store"]['init_ly']=scene.objects["Store"].worldPosition.y - scene.objects["Store"]['init_lz']=scene.objects["Store"].worldPosition.z + scene.objects["Store-panel"]['init_lx']=scene.objects["Store-panel"].worldPosition.x + scene.objects["Store-panel"]['init_ly']=scene.objects["Store-panel"].worldPosition.y + scene.objects["Store-panel"]['init_lz']=scene.objects["Store-panel"].worldPosition.z # Placement de la position de la tablette du store - scene.objects['Store'].worldScale = [0.01, 0.01, 0.01] - # applyRotationTo(scene.objects['Store'], None, (-0.2*math.pi)/180, (115*math.pi)/180, False) - applyRotationTo(scene.objects['Store'], None, (-2.38*math.pi)/180, (100*math.pi)/180, False) # dernière version - # scene.objects['Store'].applyRotation((math.pi/2+(0.59189*math.pi)/180, 0, 0), True) - # scene.objects['Store'].applyRotation((math.pi/4+(2*math.pi)/180, 0, 0), True) # avant dernière version - scene.objects['Store'].applyRotation((math.pi/2+(3*math.pi)/180, 0, 0), True) # dernière version + scene.objects['Store-panel'].worldScale = [0.01, 0.01, 0.01] + # applyRotationTo(scene.objects['Store-panel'], None, (-0.2*math.pi)/180, (115*math.pi)/180, False) + applyRotationTo(scene.objects['Store-panel'], None, (-2.38*math.pi)/180, (100*math.pi)/180, False) # dernière version + # scene.objects['Store-panel'].applyRotation((math.pi/2+(0.59189*math.pi)/180, 0, 0), True) + # scene.objects['Store-panel'].applyRotation((math.pi/4+(2*math.pi)/180, 0, 0), True) # avant dernière version + scene.objects['Store-panel'].applyRotation((math.pi/2+(3*math.pi)/180, 0, 0), True) # dernière version ## # Ouverture du store @@ -123,15 +123,15 @@ def open2 (cont): scene.objects["Store-"+upgrade_card[i]+"-card"].color = color_store_fct scene.objects["Store-"+upgrade_card[i]+"-card-icon"].color = color_store_fct scene.objects["Store-"+upgrade_card[i]+"-card-text"].color = color_store_fct - scene.objects['Store']['page_fct'] ="" + scene.objects['Store-panel']['page_fct'] ="" scene.objects['Store_text']['Text'] = " " scene.objects['Store_credits']['Text'] = "Crédits : "+str(scene.objects['Points']['upgrade_credit']) # Animation de la tablette - scene.objects['Store'].setVisible(True,True) - scene.objects['Store'].worldPosition = [-12.25, -2.7, 0.4] - scene.objects['Store']['timer'] = 0 - scene.objects['Store']['anim'] = True + scene.objects['Store-panel'].setVisible(True,True) + scene.objects['Store-panel'].worldPosition = [-12.25, -2.7, 0.4] + scene.objects['Store-panel']['timer'] = 0 + scene.objects['Store-panel']['anim'] = True scene.objects['Store_upgrade'].setVisible(False, True) scene.objects['Store_upgrade-colbox'].suspendPhysics (True) scene.objects['Store_text'].setVisible(False,True) @@ -148,28 +148,28 @@ def open_anim(): x1 = -9.05968 y1 = -5.01656 z1= 0.521224 - xi = x0+((x1-x0)/resol)*scene.objects['Store']['timer'] - yi = y0+((y1-y0)/resol)*scene.objects['Store']['timer'] - zi = z0+((z1-z0)/resol)*scene.objects['Store']['timer'] + xi = x0+((x1-x0)/resol)*scene.objects['Store-panel']['timer'] + yi = y0+((y1-y0)/resol)*scene.objects['Store-panel']['timer'] + zi = z0+((z1-z0)/resol)*scene.objects['Store-panel']['timer'] scale0=0.01 # scale1=0.169 scale1=0.2 - scalei = scale0+((scale1-scale0)/resol)*scene.objects['Store']['timer'] - scene.objects['Store'].worldPosition = [xi, yi, zi] - scene.objects['Store'].worldScale = [scalei, scalei, scalei] - scene.objects['Store']['timer']+=1 - if scene.objects['Store']['timer']== resol: - scene.objects['Store']['anim'] = False + scalei = scale0+((scale1-scale0)/resol)*scene.objects['Store-panel']['timer'] + scene.objects['Store-panel'].worldPosition = [xi, yi, zi] + scene.objects['Store-panel'].worldScale = [scalei, scalei, scalei] + scene.objects['Store-panel']['timer']+=1 + if scene.objects['Store-panel']['timer']== resol: + scene.objects['Store-panel']['anim'] = False ## # Fermeture ## def close (): - scene.objects["Store"].worldPosition.x=scene.objects["Store"]['init_lx'] - scene.objects["Store"].worldPosition.y=scene.objects["Store"]['init_ly'] - scene.objects["Store"].worldPosition.z=scene.objects["Store"]['init_lz'] - scene.objects['Store'].setVisible(False,True) + 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'].setVisible(False,True) scene.objects['Bubble-1'].setVisible(False,True) # scene.objects['Bubble-1-text'].setVisible(False,True) @@ -210,7 +210,7 @@ def hl (cont): if name == "Store_close" or name == "Store_upgrade": scene.objects[name].color = color_store_fct else: - if name == scene.objects['Store']['page_fct'] : + if name == scene.objects['Store-panel']['page_fct'] : scene.objects[name].color = color_store_activate scene.objects[name_text].color = color_store_activate scene.objects[name_icon].color = color_store_activate @@ -235,18 +235,18 @@ def card (cont): scene.objects['Store_text']['Text'] = " " # Enlever l'ancienne carte - if scene.objects['Store']['page_fct'] !="": - if scene.objects[scene.objects['Store']['page_fct']]['upgraded'] == True: - scene.objects[scene.objects['Store']['page_fct']].color = color_store_upgraded - scene.objects[scene.objects['Store']['page_fct']+'-text'].color = color_store_upgraded - scene.objects[scene.objects['Store']['page_fct']+'-icon'].color = color_store_upgraded + if scene.objects['Store-panel']['page_fct'] !="": + if scene.objects[scene.objects['Store-panel']['page_fct']]['upgraded'] == True: + scene.objects[scene.objects['Store-panel']['page_fct']].color = color_store_upgraded + scene.objects[scene.objects['Store-panel']['page_fct']+'-text'].color = color_store_upgraded + scene.objects[scene.objects['Store-panel']['page_fct']+'-icon'].color = color_store_upgraded else: - scene.objects[scene.objects['Store']['page_fct']].color = color_store_fct - scene.objects[scene.objects['Store']['page_fct']+'-text'].color = color_store_fct - scene.objects[scene.objects['Store']['page_fct']+'-icon'].color = color_store_fct + scene.objects[scene.objects['Store-panel']['page_fct']].color = color_store_fct + scene.objects[scene.objects['Store-panel']['page_fct']+'-text'].color = color_store_fct + scene.objects[scene.objects['Store-panel']['page_fct']+'-icon'].color = color_store_fct # Afficher le texte de la carte - scene.objects['Store']['page_fct'] = name_fct + scene.objects['Store-panel']['page_fct'] = name_fct scene.objects[name_fct].color = color_store_activate scene.objects[name_fct+'-icon'].color = color_store_activate scene.objects[name_fct+'-text'].color = color_store_activate @@ -269,12 +269,12 @@ def upgrade (cont): if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive : # sound_play (sndbuff_book_flip) obj = cont.owner - name_fct = scene.objects['Store']['page_fct'] + name_fct = scene.objects['Store-panel']['page_fct'] if name_fct !="": scene.objects[name_fct]['upgraded'] = True - scene.objects[scene.objects['Store']['page_fct']].color = color_store_upgraded - scene.objects[scene.objects['Store']['page_fct']+'-text'].color = color_store_upgraded - scene.objects[scene.objects['Store']['page_fct']+'-icon'].color = color_store_upgraded + scene.objects[scene.objects['Store-panel']['page_fct']].color = color_store_upgraded + scene.objects[scene.objects['Store-panel']['page_fct']+'-text'].color = color_store_upgraded + scene.objects[scene.objects['Store-panel']['page_fct']+'-icon'].color = color_store_upgraded scene.objects['Points']['upgrade_nb'] +=1 scene.objects['Points']['upgrade_credit']= scene.objects['Points']['level']- 1 - scene.objects['Points']['upgrade_nb'] scene.objects['Store_credits']['Text'] = "Crédits : "+str(scene.objects['Points']['upgrade_credit'])