Home

Wednesday, January 26, 2022

Python 3 Win 7 - RPG Systems - Simple Level System 1


 # Python Win 7

RPG Systems

Simple Level System 1

 

Brief:

_______________________________________________________________
A very short series made to help classmates in CS100 back in 2013.

 

Functionality :

_______________________________________________________________
Improvements:
  • N/A
Issues:
  • N/A

 

Demo:

_______________________________________________________________


Code snippet:

  _______________________________________________________________
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
lvl 	 = 1
xp 	 = 0
lvl_next = 25
p_str 	 = 0
p_dex 	 = 0
p_int 	 = 0

while xp >= lvl_next:
	lvl      += 1
	xp       -= lvl_next
	lvl_next = round(lvl_next * 1.5)

print("level:", lvl)
print("to level: {}%".format(int((xp / lvl_next)*100)))
print(f"Next: {lvl_next}")


Credits & Resources:

  • CS 100 - Tm R.
  • Code formatted via: http://hilite.me/ : Styling: Python, monokai

 

-END-

No comments:

Post a Comment

Conduct: Be nice and don't advertise or plug without adding value to the conversation.