mirror of
https://forge.apps.education.fr/phroy/codetower.git
synced 2024-01-27 11:35:17 +01:00
ajout des minions (orc, mage, archer), des towers
This commit is contained in:
parent
01930a14b5
commit
a19fa62b94
Binary file not shown.
@ -42,11 +42,12 @@ def stop():
|
||||
# En: Tower commands
|
||||
# Fr: Commandes des tours
|
||||
#
|
||||
# Build a tower : ct_build(x, y, name, color)
|
||||
# Build a tower : ct_build(x, y, name, color,style)
|
||||
# - x position (integer)
|
||||
# - y position (integer)
|
||||
# - name (string)
|
||||
# - color (RGB model) : purple, turquoise, magenta, orange, yellow, green, red or [R, G, B, 1]
|
||||
# - style : square or round and version (A,B or C), exemple : 'square-A'
|
||||
# - Return boolean flag
|
||||
# - True : builded
|
||||
# - False : not builded
|
||||
|
16
ct_lib.py
16
ct_lib.py
@ -112,14 +112,20 @@ def thread_stop(threads, type_txt):
|
||||
minion_carac={
|
||||
'Knight-lv1' : ["Knight", 1 , 2.0, 1.0, 0.0, 5,1],
|
||||
'Knight-lv2' : ["Knight", 2, 4.0, 1.0, 1.0, 20,1],
|
||||
'Knight-lv3' : ["Knight", 3, 8.0, 1.0, 2.0, 80,1]}
|
||||
'Knight-lv3' : ["Knight", 3, 8.0, 1.0, 2.0, 80,1],
|
||||
'Orc-lv1' : ["Orc", 1 , 2.0, 1.0, 0.0, 5,1],
|
||||
'Orc-lv2' : ["Orc", 2, 4.0, 1.0, 1.0, 20,1],
|
||||
'Orc-lv3' : ["Orc", 3, 8.0, 1.0, 2.0, 80,1]}
|
||||
|
||||
# Minion 3d object : body (male,female,old, ...), head (A,B,C,D), level
|
||||
# Minion 3d object : body (male,female,old, ...), variante (A,B,C,D, ...), level
|
||||
|
||||
minion_3d={
|
||||
'Knight-lv1' : [['Knight_m', 'Knight_f', 'OldKnight_m'],['A','B','C','D'],['common']],
|
||||
'Knight-lv2' : [['Knight_m', 'Knight_f', 'OldKnight_m'],['A','B','C','D'],['uncommon']],
|
||||
'Knight-lv3' : [['Knight_m', 'Knight_f', 'OldKnight_m'],['A','B','C','D'],['rare']]}
|
||||
'Knight-lv3' : [['Knight_m', 'Knight_f', 'OldKnight_m'],['A','B','C','D'],['rare']],
|
||||
'Orc-lv1' : [['Orc'],['A','B','C','D','E','F'],['common']],
|
||||
'Orc-lv2' : [['Orc'],['A','B','C','D','E','F'],['uncommon']],
|
||||
'Orc-lv3' : [['Orc'],['A','B','C','D','E','F'],['rare']]}
|
||||
|
||||
# Création d'un minion
|
||||
def ct_minion(x,y,cat,level):
|
||||
@ -174,7 +180,7 @@ tower_carac={
|
||||
# 'Base' : ["Base", 1.0 , 0.02, 3.0]}
|
||||
|
||||
# Création d'une tour
|
||||
def ct_build(x,y,tower_name="Tower",color=tower_purple, cat='Base'):
|
||||
def ct_build(x,y,tower_name="Tower",color=tower_purple, tower_3d="square-A",cat='Base'):
|
||||
|
||||
# Vérification de la place
|
||||
if [x,y] in scene.objects['Terrain']['scene_tile_noncontruct'] or [x,y] in scene.objects['Terrain']['scene_tile_tower']:
|
||||
@ -190,7 +196,7 @@ def ct_build(x,y,tower_name="Tower",color=tower_purple, cat='Base'):
|
||||
return False
|
||||
|
||||
# Objet 3D
|
||||
tour= scene.addObject("Tower", scene.objects['Terrain'])
|
||||
tour= scene.addObject('Tower-'+tower_3d, scene.objects['Terrain'])
|
||||
tour.color = color
|
||||
tour.worldPosition=mathutils.Vector((x,y,0.2))
|
||||
tour.worldScale=mathutils.Vector((1,1,1))
|
||||
|
@ -69,7 +69,7 @@ def waves():
|
||||
# Wave 1
|
||||
ct_map_text("Wave 1")
|
||||
for i in range (15):
|
||||
ct_minion(14,3,"Knight",1)
|
||||
ct_minion(14,3,"Orc",1)
|
||||
# ct_tempo_wave (1)
|
||||
ct_sleep (1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user