mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
69 lines
2.2 KiB
Python
69 lines
2.2 KiB
Python
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
|
import bpy # Blender
|
|
from rp_lib import * # Bibliothèque Ropy
|
|
import os
|
|
|
|
###############################################################################
|
|
# rp_map1.py
|
|
# @title: Carte 1 pour Ropy
|
|
# @project: Ropy (Blender-EduTech)
|
|
# @lang: fr
|
|
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
|
# @copyright: Copyright (C) 2020-2022 Philippe Roy
|
|
# @license: GNU GPL
|
|
#
|
|
###############################################################################
|
|
|
|
scene = bge.logic.getCurrentScene()
|
|
|
|
###############################################################################
|
|
# Map
|
|
###############################################################################
|
|
|
|
# Initialization
|
|
def map_init():
|
|
|
|
# Base
|
|
scene.objects['Terrain']['size'] = [-15,15,-10,10] # Map size
|
|
|
|
# Landscape
|
|
# file_path = 'asset/map/map1-landscape.blend'
|
|
# inner_path = 'Object'
|
|
# 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),
|
|
# filename=object_name)
|
|
|
|
# Rover
|
|
# obj=scene.objects['Rover']
|
|
# applyRotationTo(obj, None, None, 0.0, True)
|
|
|
|
# Reset counters
|
|
def map_reset():
|
|
scene.objects['Points']['step']=0
|
|
scene.objects['Points']['nbligne']=0
|
|
|
|
# scene.objects['Points']['lifes']=10
|
|
# scene.objects['Points']['lifes_max']=10
|
|
# scene.objects['Points']['coins']=0
|
|
# scene.objects['Points']['level']=0
|
|
# scene.objects['Points']['level_max']=1
|
|
# scene.objects['Points']['minions']=0
|
|
# scene.objects['Points']['minions_run']=0
|
|
# scene.objects['Points']['wave']=1
|
|
|
|
|
|
# ###############################################################################
|
|
# # Initialisation du niveau :
|
|
# # Niveau 0 : Vide
|
|
# # Niveau 1 : Les premiers pas de Ropy
|
|
# # Niveau 2 : Sécuriser Ropy
|
|
# # Niveau 3 : Partir au bout du monde
|
|
# # Niveau 4 : Faire face à l'inconnu
|
|
# # Niveau 5 : Se rendre utile
|
|
# ###############################################################################
|
|
|
|
# rp_niveau (1) # Saisir le niveau (de 0 à 5)
|
|
# ropy_init.main() # Initialisation de la scène 3D
|