codetower/ct_map.py

50 lines
1.4 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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