User Profile

Collapse

Profile Sidebar

Collapse
xZaft
xZaft
Last Activity: Jul 15 '07, 02:35 PM
Joined: Jul 12 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • xZaft
    replied to Creating an RPG
    That worked wonders! Thank you so much.
    See more | Go to post

    Leave a comment:


  • xZaft
    started a topic Creating an RPG

    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]...
    See more | Go to post
    Last edited by bartonc; Jul 12 '07, 07:45 PM. Reason: Added =python to code tags

  • xZaft
    replied to Could you finish this game?
    I beat it in 1153 moves, and 2292360 what ever time that is. Milliseconds?
    See more | Go to post

    Leave a comment:


  • xZaft
    replied to Creating a save function
    [code=Python]
    if global hp > 0:
    [/code]
    When I try and run that, it says it is invalid syntax.
    See more | Go to post

    Leave a comment:


  • xZaft
    replied to What is your OS and Python Version
    I am using Windows XP SP2. And Python 2.5
    See more | Go to post

    Leave a comment:


  • xZaft
    replied to Creating a save function
    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...
    See more | Go to post

    Leave a comment:


  • xZaft
    started a topic Creating a save function

    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+')
    ...
    See more | Go to post
    Last edited by bartonc; Jul 12 '07, 05:16 PM. Reason: removed link
No activity results to display
Show More
Working...