Sololearn: Learn to Code
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
3rd Apr 2018, 11:53 PM
Emma
+ 2
I'm starting to go a bit overboard with mine :D finished maxhp buff, potion and damage/armor additions :D I think I'll add the hp thing i made .D max_hp = 100 current_hp = 60 def healthbar(max_hp, current_hp, *args): base = "[||||||||||]" calc = int(((max_hp - current_hp) / 10)) if calc != 0: print(base[0:-calc], end="") print(" "*(len(base)-len(base[0:-calc])), end="") print("]") else: print(base) print(current_hp) healthbar(max_hp, current_hp)
4th Apr 2018, 5:51 PM
Markus Kaleton
Markus Kaleton - avatar
0
Markus Kaleton Great to see an alternative solution ☺
4th Apr 2018, 5:58 PM
Emma