User Profile
Collapse
-
That worked wonders! Thank you so much. -
Creating an RPG
[code=python]
#Game by Todd Lunter
from random import choice as _choice
import random as r
c = 'a'
level = 1
stre = 2
spd = 2
exp = 0
maxexp = 60
hp = 60
maxhp = 60
gp = 10000
sword = 0
tempHP = 0
monsterName = ['Rat', 'Bat', 'Snake']
monsterHP = [2, 5, 10]
monsterExp = [15, 30, 50]
monsterStr = [2, 1, 4]... -
I beat it in 1153 moves, and 2292360 what ever time that is. Milliseconds?Leave a comment:
-
[code=Python]
if global hp > 0:
[/code]
When I try and run that, it says it is invalid syntax.Leave a comment:
-
-
Thanks that worked very well =]
I have another concern though. I have the game set up in functions so that the switch is easier to read.
[code=Python]
while c != 'q':
main()
c = raw_input("[A]ttack [S]tore S[t]ats [L]oad Sa[v]e [Q]uit ").lower()
clear()
if c == 'a':
attack()
elif c == 's':
store()
elif c...Leave a comment:
-
Creating a save function
Code:def save(): try: saves.append(str(level)) saves.append(str(stre)) saves.append(str(spd)) saves.append(str(hp)) saves.append(str(maxhp)) saves.append(str(exp)) saves.append(str(maxexp)) saves.append(str(gp)) saves.append(str(sword)) save = open('gamesave.txt', 'r+')
No activity results to display
Show More
Leave a comment: