1.Ich will , dass wenn die lp vom gegner 0 sind dass dann sieg steht
2.Der Gegner soll auch einen Spiel zug mit random bekommen
Danke schonmal im vorraus
Code: Alles auswählen
# -*- coding: iso-8859-1 -*-
import easygui, sys, random
from player import player as p
from gegner import gegner as g
expe = p.lv / 50
exp = p.exp + expe
lp = p.ruest+p.ver
lpg = g.ruestg+g.verg
atk = p.atk+p.waffe
atkg = g.atkg+g.waffeg
wahl = easygui.buttonbox("los beginn zu Kämpfen",
choices=['Angriff', 'Verteidigen'])
if wahl == "Angriff":
dif = atk - lpg
easygui.msgbox("Punch", image="playera.gif")
elif wahl == "Verteidigen":
lp + 5
easygui.msgbox(lp, "leben + 5", image="plus.gif")
while 1:
if lpg <=0:
easygui.msgbox("SIEG!!!", image="Sieg.gif")
easygui.msgbox(expe , "Expertenpunte")
if exp >= 100:
easygui.msgbox("Du hast ein neues lv erreicht")
else:
wahl = easygui.buttonbox("weiter",
choices=['Angriff', 'Verteidigen'])
if wahl == "Angriff":
lpg - atk
easygui.msgbox("Punch", image="playera.gif")
elif wahl == "Verteidigen":
lp + 5
easygui.msgbox(lp, "leben + 5", image="plus.gif")