mirror of
https://forge.apps.education.fr/phroy/codetower.git
synced 2024-01-27 11:35:17 +01:00
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
|
from ct_lib import * # Bibliothèque CodeTower
|
|
|
|
###############################################################################
|
|
# ct_vg.py
|
|
# @title: Waves for the CodeTower game
|
|
# @project: CodeTower
|
|
# @lang: fr
|
|
# @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
|
|
#
|
|
###############################################################################
|
|
|
|
###############################################################################
|
|
# Gestion des tâches (threads) << NE PAS MODIFIER CETTE SECTION >>
|
|
###############################################################################
|
|
|
|
threads=[]
|
|
scene = bge.logic.getCurrentScene()
|
|
|
|
def start():
|
|
scene.objects['Terrain']['thread_wave']=True
|
|
thread_start(threads, "waves", vagues)
|
|
|
|
def stop():
|
|
thread_stop(threads, "waves")
|
|
|
|
###############################################################################
|
|
# Instructions élémentaires
|
|
###############################################################################
|
|
|
|
def vagues():
|
|
|
|
# Wave 1
|
|
ct_map_text("Wave 1")
|
|
for i in range (4):
|
|
ct_minion(14,3,"Knight",2)
|
|
tempo(1)
|
|
|
|
tempo(2)
|
|
print ("Threads waves #", len(threads)-1, "are arrived -> close them.") # Tâche close (thread) << NE PAS MODIFIER CETTE LIGNE >>
|
|
scene.objects['Terrain']['thread_wave']=False # Fin du cycle << NE PAS MODIFIER CETTE LIGNE >>
|