Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #game
- #im not great at python but im trying to practice for my gcses lol!!
- import random
- xp = 0
- lvl = 0
- levelNext = 5
- def var():
- global xp
- xp = 0
- global lvl
- lvl = 0
- global levelNext
- levelNext = 5
- def starter(): #displays basic char
- name = input("What is your name?")
- print("**********************************")
- print("**********************************")
- print("Your name is", name,"!!")
- print("You have 0 skill points currently.")
- print("You are currently unranked.")
- print("You have no weapons avaliable.")
- print("**********************************")
- print("**********************************")
- def levels (): #level system?? when i call it it says the variables xp and lvl are not defined and im super confused!!
- while xp >= levelNext:
- lvl = lvl + 1
- xp = xp - levelNext
- levelNext = round(levelNext * 1.5)
- return lvl
- var()
- starter()
- print(" ")
- print(" ")
- print("Maybe if you train you could improve your skill..?")
- action = int(input("What would you like to do? 1. Train"))
- if action == 1:
- print(" ")
- print(" ")
- print("You do some push ups, but you can only do 5 before giving up.. You gained 5xp!")
- xp = xp + 5
- levels() #error here
- print(" ")
- print(" ")
- print("Well done, you have reached level",lvl,"!!")
Advertisement
Add Comment
Please, Sign In to add comment