mirror of
https://forge.apps.education.fr/phroy/codetower.git
synced 2024-01-27 11:35:17 +01:00
50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
||
from ct_lib import * # Bibliothèque CodeTower
|
||
|
||
###############################################################################
|
||
# ct_map.py
|
||
# @title: Map definition
|
||
# @project: CodeTower
|
||
# @lang: fr,en
|
||
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
||
# @copyright: Copyright (C) 2022 Philippe Roy
|
||
# @license: GNU GPL
|
||
#
|
||
# This game is a tower defense coding game. The towers are driven with Python code.
|
||
#
|
||
# The file is the the waves definition
|
||
#
|
||
###############################################################################
|
||
|
||
scene = bge.logic.getCurrentScene()
|
||
|
||
###############################################################################
|
||
# Carte 1
|
||
###############################################################################
|
||
|
||
# Loading the map
|
||
def map1_init():
|
||
|
||
# Taille de la carte
|
||
scene.objects['Terrain']['taille'] = [-15,15,-10,10]
|
||
|
||
# Navmesh
|
||
scene.objects['Terrain']['navmesh'] = "Navmesh.004"
|
||
|
||
# Ajout des sorties
|
||
scene.objects['Terrain']['endtile'] = "tile_straight.036"
|
||
ct_map_end(1,-10)
|
||
ct_map_endflag(0.5,-10)
|
||
ct_map_endflag(1.5,-10)
|
||
|
||
# Reset counters
|
||
def map1_reset():
|
||
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
|
||
|