2022-03-20 05:57:07 +01:00
|
|
|
import bge
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# ct_comp.py
|
|
|
|
# @title: Composants python
|
|
|
|
# @project: CodeTower
|
2022-03-24 17:00:09 +01:00
|
|
|
# @lang: fr,en
|
2022-03-20 05:57:07 +01:00
|
|
|
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
|
|
|
# @copyright: Copyright (C) 2022 Philippe Roy
|
|
|
|
# @license: GNU GPL
|
|
|
|
#
|
2022-04-01 01:34:54 +02:00
|
|
|
# This game is a tower defense coding game. The towers are driven by Python code.
|
2022-03-20 05:57:07 +01:00
|
|
|
# Ce simulateur est un jeu du type tower defense où les tours sont à piloter par la programmation Python.
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Récupérer les objets 3D
|
2022-03-24 17:00:09 +01:00
|
|
|
# scene = bge.logic.getCurrentScene()
|
2022-03-20 05:57:07 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Minion
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
class Minion(bge.types.KX_PythonComponent):
|
|
|
|
args = OrderedDict([
|
|
|
|
("cat", ""),
|
|
|
|
("level", 0),
|
|
|
|
("hp", 0.0),
|
|
|
|
("speed", 0.0),
|
|
|
|
("armor", 0.0),
|
|
|
|
("bounty", 0),
|
|
|
|
("lifes_damage", 0)
|
|
|
|
])
|
|
|
|
|
|
|
|
def start(self, args):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def update(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Tower
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
class Tower(bge.types.KX_PythonComponent):
|
|
|
|
args = OrderedDict([
|
|
|
|
("cat", ""),
|
|
|
|
("level", 0),
|
2022-03-24 17:00:09 +01:00
|
|
|
("tower_name", ""),
|
2022-03-20 05:57:07 +01:00
|
|
|
("damage", 0.0),
|
|
|
|
("speed", 0.0),
|
|
|
|
("range", 0.0)
|
|
|
|
])
|
|
|
|
|
|
|
|
def start(self, args):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def update(self):
|
|
|
|
pass
|
|
|
|
|