Les gens (Carnot 2026, Premiere)
Nom : Project Humanoid
Thème
Tower défense : tourelle, ennemies, vagues, chemin, niveau
tours : ameliorable (personnalisation) ennemies : plus en plus forts, HUMAIN (bete, intelligents, adaptatifs, robuste) vagues : (classiques, spécial) chemin : (changements)
Lore
vous etes un scientifique recherché et condamné a mort et assaillit par vos confrères humain, mais vous ne vous laisserez pas faire...
Touches
flèches directionnelles, mouvement de souris, clic gauche
Code Python
import pyxel
pyxel.init(128, 128, fps=30, title="Nuit du Code")
pyxel.load("theme.pyxres")
h_x = 0
h_y = 115
h_hp = 75
hh_x = 8
hh_y = 115
monney = 0
c1_x = 0
c1_y = 0
x = 10
y = 10
direction = 0
add_x = 8
add_y = 0
b_x = -10
b_y = -10
addb_x = 16
addb_y = 0
vitesse_b_x = 0
vitesse_b_y = 0
status = "PLAY"
def update():
global h_x, h_y, h_hp, hh_x, hh_y, monney, c1_x, c1_y, direction, add_x, add_y, b_x, b_y, addb_x, addb_y, vitesse_b_x, vitesse_b_y
global status
if status != "PLAY":
return
c1_x = pyxel.mouse_x
c1_y = pyxel.mouse_y
if pyxel.btnp(pyxel.KEY_RIGHT):
direction = 0
add_x = 8
add_y = 0
addb_x = 16
addb_y = 0
if pyxel.btnp(pyxel.KEY_UP):
direction = -90
add_x = 0
add_y = -8
addb_x = 0
addb_y = -16
if pyxel.btnp(pyxel.KEY_LEFT):
direction = -180
add_x = -8
add_y = 0
addb_x = -16
addb_y = 0
if pyxel.btnp(pyxel.KEY_DOWN):
direction = 90
add_x = 0
add_y = 8
addb_x = 0
addb_y = 16
if pyxel.btnp(pyxel.MOUSE_BUTTON_LEFT):
b_x = pyxel.mouse_x
b_y = pyxel.mouse_y
if direction == 0:
vitesse_b_x = 4
vitesse_b_y = 0
elif direction == -90:
vitesse_b_x = 0
vitesse_b_y = -4
elif direction == -180:
vitesse_b_x = -4
vitesse_b_y = 0
elif direction == 90:
vitesse_b_x = 0
vitesse_b_y = 4
b_x += vitesse_b_x
b_y += vitesse_b_y
if h_hp > 0:
real_b_x = b_x + addb_x
real_b_y = b_y + addb_y
if h_x + 5 < real_b_x + 8 and real_b_x < h_x + 5 + 8 and h_y < real_b_y + 8 and real_b_y < h_y + 8:
h_hp -= 1
b_x = -10
b_y = -10
vitesse_b_x = 0
vitesse_b_y = 0
if h_hp <= 0:
status = "VICTORY"
if h_hp > 0:
if h_x < 110 and h_y == 115:
h_x += 1
elif h_x >= 110 and h_y > 90:
h_y -= 1
elif h_x > 5 and h_y == 90:
h_x -= 1
elif h_x == 5 and h_y > 70:
h_y -= 1
elif h_x < 110 and h_y == 70:
h_x += 1
elif h_x >= 110 and h_y > 45:
h_y -= 1
elif h_x > 5 and h_y == 45:
h_x -= 1
elif h_x == 5 and h_y > 15:
h_y -= 1
elif h_x < 110 and h_y == 15:
h_x += 1
elif h_x >= 110 and h_y == 15:
status = "GAMEOVER"
def draw():
global h_x, h_y, h_hp, hh_x, hh_y, c1_x, c1_y, direction, add_x, add_y, addb_x, addb_y, b_x, b_y
global status
t = pyxel.frame_count % 20
pyxel.blt(0, 0, 0, 0, 0, 128, 128)
if h_hp > 0:
if t < 10:
pyxel.blt(h_x + 5, h_y, 0, 16, 160, 8, 8, 7)
else:
pyxel.blt(h_x + 5, h_y, 0, 8, 160, 8, 8, 7)
pyxel.rect(h_x + 4, h_y - 3, 10, 2, 8)
pyxel.rect(h_x + 4, h_y - 3, h_hp * 3 + 1, 2, 11)
else:
pyxel.blt(h_x + 5, h_y, 0, 8, 160, 8, -8, 7)
pyxel.blt(c1_x, c1_y, 0, 0, 144, 8, 8, 7)
pyxel.blt(c1_x + add_x, c1_y + add_y, 0, 8, 144, 8, 8, 7, direction)
if vitesse_b_x != 0 or vitesse_b_y != 0:
pyxel.blt(b_x + addb_x, b_y + addb_y, 0, 24, 144, 8, 8, 7, direction)
if status == "GAMEOVER":
pyxel.rect(24, 50, 80, 24, 0)
pyxel.text(46, 59, "GAME OVER", 8)
elif status == "VICTORY":
pyxel.rect(24, 50, 80, 24, 0)
pyxel.text(49, 59, "VICTOIRE !", 11)
pyxel.run(update, draw)