Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text Game Testing/Dev
#1
Hey Guys!
I am PKMindBlow and I am currently working on a text game inspired by EarthBound and the Mother Series in general. It also uses some custom ASCII artwork I\'ve been working on. Also, I am new to the forum so I don\'t know how this works.
Anyway. I\'ve been wondering if anyone would want to test it out, give opinions, etc.
Thank you, and here's the code! Big Grin
AREA = 0
MAXHP = 10
HP = 10
HP2 = 10
EHP = 6
time.sleep(3)
print('This game is a text adventure, therefore its gameplay is strictly limited to battles, buying items, talking to people and looking for secrets.')
print('Due to this, the focal point of this game is to tell a story and to demonstrate Python\'s text adventure capabilities.')
print('Thank you,\nEnjoy!')
time.sleep(6)
print(' ____                                                              /\                                  ')
print('|                                       |                         /  \           |                         |')
print('|                                       |                        /    \          |                         |')
print('|____         _____   ____          ____|  ______               /______\     ____|         _____   ____  __|__          ____   _____')
print('|     \    / |_____| |    | \    / |    | |    |  \    /       /        \   |    | \    / |_____| |    |   |    |    | |    | |_____|') 
print('|      \  /  |       |       \  /  |    | |    |   \  /       /          \  |    |  \  /  |       |    |   |    |    | |      |')
print('|____   \/   |_____| |        \/   |____| |____|_   \/       /            \ |____|   \/   |_____| |    |   |    |____| |      |_____|')
print('                              /                     /')
print('                             /                     /')
print('A wacky adventure in a world all to real!')
input('Hit Enter')

for x in range(0, 100):
    print('')
time.sleep(2)
print('Centown')
time.sleep(2)
print('3:00 AM')
time.sleep(2)
print('1999')
time.sleep(2)
print('Zero awakes to a call on his walkie-talkie which is under the pillow.')
time.sleep(2)
print('*ZERO..KRSHK..CLUBHOUSE..KRSHK..NOW!*')
time.sleep(2)
print('You\'ll need a weapon.')
input('Hit Enter')
AREA = 0
I = ['']
PARTY = ['']
while 0 == 0:
    if AREA == 0:
        print('You are in your room. To the West is the living room. Your baseball bat (WB) lies on the dresser.')
        password = input(':')
        if password == 'W':
            if I[0] == '':
                print('What about that weapon!')
            if I[0] == 'BAT':
                print('OK')
                AREA = AREA+1
        if password == 'WB':
            if I[0] == '':
                print('It was your Dad\'s before you got it...You love baseball, but you haven\'t played baseball since he left...')
                input('Hit Enter')
                for x in range(0, 100):
                    print('   #')
                input('Hit Enter')
                print('Got The Wooden Bat')
                I.append('BAT')
                del I[0]
            else:
                print('You already have a bat!')
    if AREA == 1:
        print('You\'re in the living room. Nothing to see really, except that the door is to the N')
        password = input(':')
        
        if password == 'N':
            print('You step outside...')
            AREA = AREA+1
        if password == 'E':
            print('You reenter your room.')
            input('Hit Enter')
            print('But you can\'t sleep knowing that Echo needed you!')
            input('Hit Enter')
            for x in range(0, 50):
                print('')
    if AREA == 2:
        print('You are outside your house. To the N is Echo\'s house.')
        password = input(':')
        if password == 'N':
            print('You step forward...')
            input('Hit Enter')
            print('An Enemy Approaches!')
            time.sleep(3)
            for x in range(0, 50):
                print('          |               ')
            print('Runaway Toast Man Approaches!\n')
            print('     ____      ___ ')
            print('    //   \____/   \ ')
            print('    ||             | ')
            print('____||   V      V  |____ ')
            print('    ||             | ')
            print('    ||        o    | ')
            print('    \\____________/ ')
            print('     /            \ ')
            print('    /             / ')
            print('Your Turn')
            input('Hit Enter')
            password = input('Swing Bat(1) Defend(2) PA(N/A)')
            if password == 'N/A':
                print('Wow. You take things waaaaaay to literally!')
                print('But seriously, you know absolutely no Psychic Abilities...')
            if password == '1':
                OPTS = [0, 0, 1]
                
            if passwrod == '2':
                print('Zero is guarding!')
                DEF = 0
            
                
            
            
            
        
            








#COOL TOAST or DAD
#print('  ___      ___ ')
#print(' ////\____/\\\\ ')
#print('|\____________/| ')
#print('| \____/\____/ | ')
#print('|              | ')
#print('|    \____/    | ')
#print(' \____________/ ')

#TEXT IDEAS
#My Boulder has evovled into a.....Mega Frickin MOUNTAIN!!!
#Swag Bagels
#Jammin Toast Man...a Toastman with a guitar!
#Echo tried PA Lightning! Then he remembers that he can\'t use PA\'s


                      
def ECHOFINALBREATH():
    print('Echo dives in front of the shot, throwing the bomb simultaneously')
    time.sleep(2.5)
    print('Zero : ECHO NO!')
    time.sleep(3)
    print('Infinity : IN THE SHORT TIME I\'VE BEEN LIVING...I\'VE DISRUPTED YOUR LIFE GREATLY...')
    time.sleep(2)
    print('Infinity : AND WITH MY FINAL BREATHS I WILL VOW TO CONTINUE DOING SO...')
    time.sleep(2)
    print('Infinity began to make modem noises...')
    time.sleep(2)
    print('Infinty\'s thruster rocket launched him into the sky...')
    time.sleep(2)
    print('Echo : Zero...was I help..ful?')
    time.sleep(2)
    print('Zero : Oh....Echo...You...you....')
    time.sleep(2)
    print('Echo : Don\'t...worry, Zero...Just get the heck outta here...')
    time.sleep(2)
    print('Echo gave his final breath...')
    time.sleep(5)
    print('Zero began to cry...')
    time.sleep(3.5)
    print('However\n He knew what he had to do.')
    
PS: The battle sequence isn't finished, and I recommend you run this in fullscreen Python 3.3 GUI. And yes I know I\'ve been making backslashes at every apostrophe. It's a Python habit.

Just realized that this doesn't have imports at the top!
Add import time to the top of the code in order to fix this.
Here is the updated code!

import time
import random
AREA = 0
MAXHP = 10
HP = 10
HP2 = 10
EHP = 6
time.sleep(3)
print('This game is a text adventure, therefore its gameplay is strictly limited to battles, buying items, talking to people and looking for secrets.')
print('Due to this, the focal point of this game is to tell a story and to demonstrate Python\'s text adventure capabilities.')
print('Thank you,\nEnjoy!')
time.sleep(6)
print(' ____                                                              /\                                  ')
print('|                                       |                         /  \           |                         |')
print('|                                       |                        /    \          |                         |')
print('|____         _____   ____          ____|  ______               /______\     ____|         _____   ____  __|__          ____   _____')
print('|     \    / |_____| |    | \    / |    | |    |  \    /       /        \   |    | \    / |_____| |    |   |    |    | |    | |_____|') 
print('|      \  /  |       |       \  /  |    | |    |   \  /       /          \  |    |  \  /  |       |    |   |    |    | |      |')
print('|____   \/   |_____| |        \/   |____| |____|_   \/       /            \ |____|   \/   |_____| |    |   |    |____| |      |_____|')
print('                              /                     /')
print('                             /                     /')
print('A wacky adventure in a world all to real!')
input('Hit Enter')

for x in range(0, 100):
    print('')
time.sleep(2)
print('Centown')
time.sleep(2)
print('3:00 AM')
time.sleep(2)
print('1999')
time.sleep(2)
print('Zero awakes to a call on his walkie-talkie which is under the pillow.')
time.sleep(2)
print('*ZERO..KRSHK..CLUBHOUSE..KRSHK..NOW!*')
time.sleep(2)
print('You\'ll need a weapon.')
input('Hit Enter')
AREA = 0
I = ['']
PARTY = ['']
while 0 == 0:
    if AREA == 0:
        print('You are in your room. To the West is the living room. Your baseball bat (WB) lies on the dresser.')
        password = input(':')
        if password == 'W':
            if I[0] == '':
                print('What about that weapon!')
            if I[0] == 'BAT':
                print('OK')
                AREA = AREA+1
        if password == 'WB':
            if I[0] == '':
                print('It was your Dad\'s before you got it...You love baseball, but you haven\'t played baseball since he left...')
                input('Hit Enter')
                for x in range(0, 100):
                    print('   #')
                input('Hit Enter')
                print('Got The Wooden Bat')
                I.append('BAT')
                del I[0]
            else:
                print('You already have a bat!')
    if AREA == 1:
        print('You\'re in the living room. Nothing to see really, except that the door is to the N')
        password = input(':')
        
        if password == 'N':
            print('You step outside...')
            AREA = AREA+1
        if password == 'E':
            print('You reenter your room.')
            input('Hit Enter')
            print('But you can\'t sleep knowing that Echo needed you!')
            input('Hit Enter')
            for x in range(0, 50):
                print('')
    if AREA == 2:
        print('You are outside your house. To the N is Echo\'s house.')
        password = input(':')
        if password == 'N':
            print('You step forward...')
            input('Hit Enter')
            print('An Enemy Approaches!')
            time.sleep(3)
            for x in range(0, 50):
                print('          |               ')
            print('Runaway Toast Man Approaches!\n')
            print('     ____      ___ ')
            print('    //   \____/   \ ')
            print('    ||             | ')
            print('____||   V      V  |____ ')
            print('    ||             | ')
            print('    ||        o    | ')
            print('    \\____________/ ')
            print('     /            \ ')
            print('    /             / ')
            print('Your Turn')
            input('Hit Enter')
            password = input('Swing Bat(1) Defend(2) PA(N/A)')
            if password == 'N/A':
                print('Wow. You take things waaaaaay to literally!')
                print('But seriously, you know no Psychic Abilities...')
            if password == '1':
                OPTS = [0, 0, 1]
                
            if passwrod == '2':
                print('Zero is guarding!')
                DEF = 0
            
                
            
            
            
        
            








#COOL TOAST or DAD
#print('  ___      ___ ')
#print(' ////\____/\\\\ ')
#print('|\____________/| ')
#print('| \____/\____/ | ')
#print('|              | ')
#print('|    \____/    | ')
#print(' \____________/ ')

#TEXT IDEAS
#My Boulder has evovled into a.....Mega Frickin MOUNTAIN!!!
#Swag Bagels
#Jammin Toast Man...a Toastman with a guitar!
#Echo tried PA Lightning! Then he remembers that he can\'t use PA\'s


                      
def ECHOFINALBREATH():
    print('Echo dives in front of the shot, throwing the bomb simultaneously')
    time.sleep(2.5)
    print('Zero : ECHO NO!')
    time.sleep(3)
    print('Infinity : IN THE SHORT TIME I\'VE BEEN LIVING...I\'VE DISRUPTED YOUR LIFE GREATLY...')
    time.sleep(2)
    print('Infinity : AND WITH MY FINAL BREATHS I WILL VOW TO CONTINUE DOING SO...')
    time.sleep(2)
    print('Infinity began to make modem noises...')
    time.sleep(2)
    print('Infinty\'s thruster rocket launched him into the sky...')
    time.sleep(2)
    print('Echo : Zero...was I help..ful?')
    time.sleep(2)
    print('Zero : Oh....Echo...You...you....')
    time.sleep(2)
    print('Echo : Don\'t...worry, Zero...Just get the heck outta here...')
    time.sleep(2)
    print('Echo gave his final breath...')
    time.sleep(5)
    print('Zero began to cry...')
    time.sleep(3.5)
    print('However\n He knew what he had to do.')
    
Reply
#2
Hey! I have an engine for making text games! If you want to use it, ill send it to you. Just do NOT! Give it to other people. This is a private engine. Got It?
Reply
#3
For sure! You're the first person to respond.
Send it to me, and hopefully I'll be able to finish this idea!
Thank you!
Reply
#4
Here is some of my older work.
It's a game that runs directly through python, no pygame or anything.
I'm not sure anyone else has caught on to this method.
This is LINEFALL. Use the arrow keys to move. Hit Enter to jump to the hole(Beware you only have 3 jumps) Just navigate through the hole. This was my first game, it also incorporates winsound. So, if you don't have Windows, tell me and I'll take it out.
import turtle
import winsound
import time
import random
import sys
screen = turtle.Screen()

sys.setrecursionlimit(999999999)
from tkinter import *
A = turtle.Pen()
B = turtle.Pen()
C = turtle.Pen()
A.up()
B.up()
C.up()
A.speed(0)
B.speed(0)
C.speed(0)
A.shape('circle')

B.shape('square')
C.shape('square')
C.shapesize(1, 35)
B.shapesize(1, 35)
C.left(90)
C.fd(300)
C.right(90)
C.bk(400)
B.left(90)
B.fd(300)
B.right(90)
B.fd(400)
A.up()
A.right(90)
A.fd(200)
A.left(90)
#EACH SIDE == 540px
#FULL 1080px


OPTS = [1, 2, 3, 0, -1, -2]
def END():
    beatlength = 300
    beathalf = 150
    winsound.Beep(262, beatlength) # C (double length)
    winsound.Beep(247, beathalf) # 
    winsound.Beep(220, beathalf) # A
    winsound.Beep(196, beathalf) # G
    winsound.Beep(220, 2*beatlength) # B
    
    
    

    
    
def START():
    HARD = 0
    beatlength = 300
    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, beatlength) # C
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, 2*beatlength) # D (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(247, 2*beatlength) # B (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(349, beatlength) # F
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, beatlength) # D
    winsound.Beep(262, beatlength) # C

    winsound.Beep(247, beatlength) # B
    winsound.Beep(196, beatlength) # G
    winsound.Beep(220, beatlength) # A
    winsound.Beep(247, beatlength) # B

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(262, 2*beatlength) # C (double length)
    while 0 == 0:
        random.shuffle(OPTS)
        X = 0
        if OPTS[0] == 1:
            B.fd(100)
            C.fd(100)
        if OPTS[0] == 2:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 3:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 0:
            B.bk(100)
            C.bk(100)
        if OPTS[0] == -1:
            B.bk(200)
            C.bk(200)
        if OPTS[0] == -2:
            B.bk(200)
            C.bk(200)
        Y = B.xcor() +360
        Z = B.xcor() -360
        YY = C.xcor() +360
        ZZ = C.xcor() -360
        while X < 60:
            B.goto(B.xcor(), B.ycor()-10)
            time.sleep(0.01)
            C.goto(C.xcor(), C.ycor()-10)
            time.sleep(0.01)
            
            X = X +1
            while A.xcor() > Z and A.xcor() < Y and A.ycor() == B.ycor():
        
                A.write('GAME OVER!')
                END()
                break
            while A.xcor() < YY and A.xcor() > ZZ and A.ycor() == C.ycor():
                A.write('GAME OVER!')
                END()
                break
        B.goto(400.00,300.00)
        C.goto(-400.00,300.00)
def HARD():        
    beatlength = 200
    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, beatlength) # C
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, 2*beatlength) # D (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(247, 2*beatlength) # B (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(349, beatlength) # F
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, beatlength) # D
    winsound.Beep(262, beatlength) # C

    winsound.Beep(247, beatlength) # B
    winsound.Beep(196, beatlength) # G
    winsound.Beep(220, beatlength) # A
    winsound.Beep(247, beatlength) # B

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(262, 2*beatlength) # C (double length)
    while 0 == 0:
        random.shuffle(OPTS)
        X = 0
        if OPTS[0] == 1:
            B.fd(100)
            C.fd(100)
        if OPTS[0] == 2:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 3:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 0:
            B.bk(100)
            C.bk(100)
        if OPTS[0] == -1:
            B.bk(200)
            C.bk(200)
        if OPTS[0] == -2:
            B.bk(200)
            C.bk(200)
        Y = B.xcor() +360
        Z = B.xcor() -360
        YY = C.xcor() +360
        ZZ = C.xcor() -360
        while X < 60:
            B.goto(B.xcor(), B.ycor()-10)
            
            C.goto(C.xcor(), C.ycor()-10)
            
            
            X = X +1
            while A.xcor() > Z and A.xcor() < Y and A.ycor() == B.ycor():
        
                A.write('GAME OVER!')
                END()
                break
            while A.xcor() < YY and A.xcor() > ZZ and A.ycor() == C.ycor():
                A.write('GAME OVER!')
                END()
                break
        B.goto(400.00,300.00)
        C.goto(-400.00,300.00)          
def CRAZY():
    
    beatlength = 140
    
    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, beatlength) # C
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, 2*beatlength) # D (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(247, 2*beatlength) # B (double length)

    winsound.Beep(262, beatlength) # C
    winsound.Beep(262, beatlength) # C
    winsound.Beep(294, beatlength) # D
    winsound.Beep(330, beatlength) # E

    winsound.Beep(349, beatlength) # F
    winsound.Beep(330, beatlength) # E
    winsound.Beep(294, beatlength) # D
    winsound.Beep(262, beatlength) # C

    winsound.Beep(247, beatlength) # B
    winsound.Beep(196, beatlength) # G
    winsound.Beep(220, beatlength) # A
    winsound.Beep(247, beatlength) # B

    winsound.Beep(262, 2*beatlength) # C (double length)
    winsound.Beep(262, 2*beatlength) # C (double length)
    while 0 == 0:
        random.shuffle(OPTS)
        X = 0
        if OPTS[0] == 1:
            B.fd(100)
            C.fd(100)
        if OPTS[0] == 2:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 3:
            B.fd(200)
            C.fd(200)
        if OPTS[0] == 0:
            B.bk(100)
            C.bk(100)
        if OPTS[0] == -1:
            B.bk(200)
            C.bk(200)
        if OPTS[0] == -2:
            B.bk(200)
            C.bk(200)
        Y = B.xcor() +360
        Z = B.xcor() -360
        YY = C.xcor() +360
        ZZ = C.xcor() -360
        while X < 60:
            B.goto(B.xcor(), B.ycor()-25)
            
            C.goto(C.xcor(), C.ycor()-25)
            
            
            X = X +1
            while A.xcor() > Z and A.xcor() < Y and A.ycor() == B.ycor():
        
                A.write('GAME OVER!')
                END()
                break
            while A.xcor() < YY and A.xcor() > ZZ and A.ycor() == C.ycor():
                A.write('GAME OVER!')
                END()
                break
        B.goto(400.00,300.00)
        C.goto(-400.00,300.00)
HYPER = 3
canvas = Canvas()
def MOVE(event,):
    global HYPER
    if event.keysym == '1':
        START()
    if event.keysym == 'Left':
        A.bk(40)
    if event.keysym == 'Right':
        A.fd(40)
    if event.keysym == '2':
        HARD()
    if event.keysym == '3':
        CRAZY()
    if event.keysym == 'Return':
       while HYPER > 0:
           A.goto(B.xcor() -400, -200)
           HYPER = HYPER -1
           break
        
canvas.bind_all('<KeyRelease-1>', MOVE)
canvas.bind_all('<KeyRelease-Left>', MOVE)
canvas.bind_all('<KeyRelease-Right>', MOVE)
canvas.bind_all('<KeyRelease-2>', MOVE)
canvas.bind_all('<KeyRelease-3>', MOVE)
canvas.bind_all('<KeyRelease-Return>', MOVE)

DO NOT HOLD DOWN THE KEYS! Press the arrow keys rapidly to move.
PS: Hit 1 for easy mode, 2 for medium, and 3 for insanity.
Reply
#5
Reply
#6
Uh, Python tag didn't really work in previous and code ended with print('#.
Have you not copied all the code, or is there a characters/line limit you reached in the post?
Reply
#7
Sorry J.crater, the moderator note was targted for PkMindBlow, not you!
Let's see if I can move it.
Reply
#8
(Jan-20-2018, 12:53 PM)Larz60+ Wrote: Sorry J.crater, the moderator note was targted for PkMindBlow, not you!
Let's see if I can move it.

No problem Larz! Let me/us know if you see a way to simply move the note. It may be useful in future.
Reply
#9
click on the x in moderator note, and redo
Reply
#10
Just checked settings. MyBB is set to unlimited characters. However the server could be protected from spam at around 30K characters. If you check the number of characters in his post its 34340 characters. If your going to post code that long you need to post it elsewhere, and link back here anyways. A good place would be Github or BitBucket.

Im not going to delve into the server limit really as i think its too many characters to allow in one post....unless the team wants unlimited.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding an inventory and a combat system to a text based adventure game detkitten 2 6,806 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Using classes for room movement (text game) Lawr3y 3 6,483 Aug-20-2019, 12:40 AM
Last Post: Lawr3y
  Text Based Game DuaneJack 3 3,505 Aug-15-2018, 12:02 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020