Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text Game Testing/Dev
#11
TAKEN DOWN FOR "MAXIMUM CHARACTER LIMIT EXCEEDED"
Reply
#12
Pre-official warning ... Stop posting huge amounts of code!
You are overriding buffer limits and thus closing code tag
is not seen.
No one will read garbage formatted this way.
You need to seriously take a look of breaking your code into smaller modules!
Reply
#13
im giving a warning.

I blatantly state here
https://python-forum.io/Thread-Text-Game...7#pid36917
that you cannot post that many characters here and then you post it again.

If your code is that long then you need to post the code in github or bitbucket and post the link here on the forums.
Recommended Tutorials:
Reply
#14
I understand the program is quite long. I checked the BBCode section, and the only error in my program was the first tag being inserted on the same line as my first line of code. I was not aware of the character count (And did not find it in the Help/Rules section either). I've realized my mistake, and will reissue my code in several parts (All following BBCode tags and character limit rules). Again, according to my first post I am very inexperienced with this forum, and have only worked with Python 3 for roughly 5 years. I've found that the while loops are a bit clunky, however this was the way I taught myself to do it. I do not however, think it is "garbage" as it was described by Larz60+. Plus, I'm most likely not as old as you, nor as experienced. I will try to avoid these mistakes in the future. Thank you.
- PKMindBlow
Reply
#15
You are one of few that have posted that much. So it doesnt happen enough. But i can add that into help docs.

I think larz meant garbage as in the code not being formatted and thus unreadable, not to the actual content.
Recommended Tutorials:
Reply
#16
Oh. Must have read the post wrong, I'll try to attach a Notepad file, or post it in several peices.
Reply
#17
Also, I'm very sorry if I caused trouble with the servers. I wasn't aware that my code was exceeding the limit at the moment of your 2nd warning post. I had assumed it was just a one time copy/paste problem.
Reply
#18
its not that big of a deal, just be aware that large code cant be posted.
Recommended Tutorials:
Reply
#19
Here is a new "space survival" game. Some things are a bit hard to understand, so here are some basics.
1.) Synthesize is like crafting.
2.) After synthesizing a Frag Farm you need to go outside and build it.
3.) To find materials, Venture out of the base.
4.) When you respawn, only the items stored in your base will be saved.
import random
import sys
import time
#(3)
print('// CAPTAIN\'S COMP // ')
print('NAME PLEASE')
    
NAME = input('>>> ')
for x in range(0, 100):
    print('')
print('You, Captain', NAME, 'are stranded with your ship on an unknown planet.')
print('Your ship\'s AI turned against you and your crew...The giant ship orbits the planet in mockery.')
print('You\'ll need 3 repair kits, and 50 units of fuel to get off.')
print('But for now, you\'ll need to survive on.........')
input('Hit Enter')
print('#########################################################')
print('#        ____                             /____\        #')         
print('#       |    | |                    |    /      \       #')
print('#       |____| |   __    __   ___  _|_  |   []   |      #')
print('#       |      |  /  \| |  | |___|  |   |   []   |      #')
print('#       |      |  \__/| |  | |___   |   |   []   |      #')
print('#                                        \      /       #')              
print('#              ____        ___           /  __  \       #')
print('#              \   \      /   /         /__/##\__\      #')
print('#               \   \    /   /             ####         #')
print('#                \   \  /   /               ##          #')
print('#                 \   \/   /                   |]       #')
print('#                  \      /                ____|____    #')
print('#                  /      \               /####  ###\   #')
print('#                 /   /\   \             /####     ##\  #')
print('#                /   /  \   \           |  #### ###   | #')
print('#               /   /    \   \           \   ##  ##  /  #')
print('#              /___/      \___\           \_________/   #')
print('#                                                       #')
print('#########################################################')
print('An independantly developed, space-survival game.')
input('Hit Enter')
AREA = 0
HP = 100
OXY = 100
TANK = 100
SCRAP = 0
SALT = 0
EGG = 0
SLIME = 0
MEAT = 0
ELEC = 0
RAT = 0
MED = 0
PILL = 0
RE = 0
RI = 0
SSCRAP = 0
SSALT = 0
SEGG = 0
SSLIME = 0
SMEAT = 0
SELEC = 0

SRAT = 0
SMED = 0
SPILL = 0
SRE = 0
SRI = 0
REPAIR = 0
FUEL = 0
FARM = 0
WATER = 100
HOUR = 0
BFARM = 0
FRAG = 0
SA = [0, 0, 0, 1, 1]
ATK = 5
FR = [1, 1, 0, 0, 2, 2, 3]
G = 0
DAY = 1
HM = [0, 0, 0, 1]
X = 5
while 0 == 0:
    if DAY == 100:
        print('Today, the Super Nova fired something out of its missile bay...')
        input('Hit Enter')
        print('It appears the AI that got you here has sentanced your death.')
        input('Hit Enter')
        print('The missile hits half an hour later. You and your planet are obliterated.')
        print('YOU TOOK TO LONG!!!')
    if DAY == 99:
        print('You get an eery feeling about your little planet...')
        print('You don\'t know why, but you just want to leave in fear.')
        input('Hit Enter')
        for x in range(0, 100):
            print('')
    
    print('TIME', HOUR)
    print('DAY', DAY)
    if HP <= 0:
        print('You are dead!')
        print('You will respawn in your ship only with the items in storage.')
        AREA = 0
        HP = 100
        OXY = 100
        TANK = 100
        SCRAP = 00
        SALT = 00
        EGG = 00
        SLIME = 00
        MEAT = 00
        ELEC = 00
        RAT = 00
        MED = 00
        PILL = 00
        input('Hit Enter')
    if TANK <= 0 and AREA != 0:
        print('You don\'t have any Oxygen!')
        print('HP -10!')
        HP = HP -10
    
    if HOUR == 50:
        HOUR = 0
        DAY = DAY +1
    if AREA == 2:
        print('You are on the rocky plain of Planet X')
        print('You can:')
        print('1.) Search for Frags')
        print('2.) Search for Salt')
        print('3.) Drop Items')
        print('4.) Scavenge')
        print('5.) Head to Raider Camp')
        print('e.) Exit')
        TANK = TANK -0.5
        HOUR = HOUR +1
        password = input(':')
        if password == '5':
            print('You walk to the Raider Camp')
            input('Hit Enter')
            random.shuffle(FR)
            if FR[0] == 0:
                print('You got 1 Meat')
                MEAT = MEAT +1
            if FR[0] == 1:
                print('You got 1 Ration')
                RAT = RAT +1
            if FR[0] == 2:
                print('Ambushed by a Raider')
                print('Oh No!')
                print('An extraterrestrial Raider!')
                while 0 == 0:
                    print('1.) Attack')
                    print('2.) Run')
                    A = input(':')
                    if A == '1':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You missed!')
                            G = G -1
                        if HM[0] == 1:
                            print('You hit!')
                            print('You killed the Raider.')
                            input('Got 1 Meat\nHit Enter')
                            MEAT = MEAT +1
                            break
                    if A == '2':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You failed to run!')
                        if HM[0] == 1:
                            print('You escaped!')
                            break
                    random.shuffle(HM)
                    if HM[0] == 1:
                        print('You were hit for 40 HP, you lost 20 Oxygen')
                        HP = HP -40
                        TANK = TANK -20
                    if HM[0] != 1:
                        print('Raider missed!')
        if password == '4':
            random.shuffle(FR)
            if FR[0] == 0:
                print('Keep Searching!')
            if FR[0] == 1:
                print('Found 1 Scrap Metal!')
                SCRAP = SCRAP +1
            if FR[0] == 2:
                print('Found 1 Electronic!')
                ELEC = ELEC +1
            if FR[0] == 3:
                print('Oh No!')
                print('An extraterrestrial Raider!')
                while 0 == 0:
                    print('1.) Attack')
                    print('2.) Run')
                    A = input(':')
                    if A == '1':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You missed!')
                            G = G -1
                        if HM[0] == 1:
                            print('You hit!')
                            print('You killed the Raider.')
                            input('Got 1 Meat\nHit Enter')
                            MEAT = MEAT +1
                            break
                    if A == '2':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You failed to run!')
                        if HM[0] == 1:
                            print('You escaped!')
                            break
                    random.shuffle(HM)
                    if HM[0] == 1:
                        print('You were hit for 40 HP, you lost 20 Oxygen')
                        HP = HP -40
                        TANK = TANK -20
                    if HM[0] != 1:
                        print('Raider missed!')
        if password == 'e' or password == 'E':
            AREA = AREA -1
        if password == '1':
            print('You search for Frags...')
            random.shuffle(FR)
            if FR[0] == 0:
                print('Found nothing...')
            if FR[0] == 1:
                print('Found a Frag!')
                FRAG = FRAG +1
            if FR[0] == 2:
                print('Oh No! A Toxic Frag!')
                while 0 == 0:
                    print('1.) Use weapon/hands')
                    print('2.) Run')
                    A = input(':')
                    if A == '1':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You missed!')
                            G = G -1
                        if HM[0] == 1:
                            print('You hit!')
                            print('You killed the Toxic Frag.')
                            break
                    if A == '2':
                        random.shuffle(HM)
                        if HM[0] == 0:
                            print('You failed to run!')
                        if HM[0] == 1:
                            print('You escaped!')
                            break
                    random.shuffle(HM)
                    if HM[0] == 1:
                        print('You were hit for 10 HP, you lost 10 Oxygen')
                        HP = HP -10
                        TANK = TANK -10
                    if HM[0] != 1:
                        print('Toxic Frag missed!')
                    
                            
        if password == '2':
            random.shuffle(SA)
            if SA[0] == 1:
                print('Found 1 Salt!')
                SALT = SALT +1
            if SA[0] != 1:
                print('Keep Searching!')
        if password == '3':
            while 0 == 0:
                print('What do you want to drop?')
                print('1.) Scrap Metal :', SCRAP)
                print('2.) Salt', SALT)
                print('3.) Frag Eggs', EGG)
                print('4.) Frag Slime', SLIME)
                print('5.) Frag Meat', MEAT)
                print('6.) Electronics', ELEC)
                print('7.) Rations', RAT)
                print('8.) Medkits', MED)
                print('9.) Pills', PILL)
                
                print('e.) Exit')
                A = input(':')
                if A == 'E' or A == 'e':
                    break
                if A == '1' and SCRAP >= 1:
                    
                    SCRAP = SCRAP -1
                if A == '2' and SALT >= 1:
                   
                    SALT = SALT -1
                if A == '3' and EGG >= 1:
                    
                    EGG = EGG -1
                if A == '4' and SLIME >= 1:
                  
                    SLIME = SLIME -1
                if A == '5' and MEAT >= 1:
                    
                    MEAT = MEAT -1
                if A == '6' and ELEC >= 1:
                    
                    ELEC = ELEC -1
                if A == '7' and RAT >= 1:
                    
                    RAT = RAT -1
                if A == '8' and MED >= 1:
                    
                    MED = MED -1
                if A == '9' and PILL >= 1:
                   
                    PILL = PILL -1
                
    if AREA == 1:
        print('You\'re just outside your ship.')
        print('You can:')
        print('1.) Venture out of the base')
        print('2.) Build')
        if BFARM == 1:
            print('3.) Enter Frag Farm')
        print('e.) Enter Ship')
        password = input(':')
        TANK = TANK -0.5
        HOUR = HOUR +1
        if password == '1':
            print('You leave the crater where your base lies...')
            #(2.5)
            for x in range(0, 100):
                print('')
            AREA = AREA +1
        if password == 'e' or password == 'E':
            AREA = AREA -1
            
        if password == '3' and BFARM == 1:
            while 0 == 0:
                print('You have', FRAG, 'Frags')
                
                print('1.) Kill Frags')
                print('2.) Release Frags')
                print('3.) Feed Frags', FRAG, 'Salt')
                print('4.) Kill All But One')
                print('e.) Exit')
                A = input(':')
                if A == '4' and FRAG >= 2:
                    FRAG = (FRAG)-(FRAG-1)
                    
                if A == '3' and SALT >= FRAG:
                    SALT = SALT - FRAG
                    print('The Frags multiplied!')
                    FRAG = FRAG +FRAG
                    
                
                if A == '1':
                    print('Got', FRAG, 'Meat')
                    print('Got', FRAG, 'Slime')
                    print('Got', FRAG, 'Eggs')
                    SLIME = SLIME +FRAG
                    EGG = EGG +FRAG
                    MEAT = MEAT +FRAG
                    FRAG = 0
                if A == '2':
                    FRAG = 0
                if A == 'e' or A == 'E':
                    break
        if password == '2' and FARM >= 1:
            print('Building a Frag Farm...')
            input('Hit Enter')
            print('Frag Farm built!')
            print('Now you need some Frags!')
            input('Hit Enter')
            FARM = FARM -1
            BFARM = 1
            
        
    if AREA == 0:
        
        
        
        print('You\'re in your ship.')
        print('You can:')
        print('1.) Redraw the screen')
        print('2.) Store Items')
        print('3.) Synthesize')
        print('4.) Extract')
        print('5.) Lift Off')
        
        print('6.) Sleep for the night')
        
        print('7.) Fill Oxygen Tank')
        print('8.) Take Items')
        print('9.) Use Items')
        print('s.) Ship Statistics')
        print('i.) Inventory')
        print('e.) Exit')
        password = input(':')
        HOUR = HOUR +1
        if password == '9':
            while 0 == 0:
                print('What do you want to use?')
                
                print('1.) Frag Eggs', EGG)
                print('2.) Frag Meat', MEAT)
                print('3.) Rations', RAT)
                print('4.) Medkits', MED)
                print('5.) Pills', PILL)
                print('e.) Exit')
                A = input(':')
                if A == 'E' or A == 'e':
                    break
                
                if A == '1' and EGG >= 1:
                    
                    EGG = EGG -1
                    HP = HP +30
                    print('You recovered 30 HP')
                if A == '2' and MEAT >= 1:
                    
                    MEAT = MEAT -1
                    HP = HP +30
                    print('You recovered 30 HP')
                if A == '3' and RAT >= 1:
                    
                    RAT = RAT -1
                    print('You recovered 100 HP')
                    HP = HP +100
                if A == '4' and MED >= 1:
                    
                    MED = MED -1
                    HP = HP + 50
                    TANK = TANK +25
                    print('You recovered 50 HP and 25 Oxygen')
                if A == '5' and PILL >= 1:
                   
                    PILL = PILL -1
                    print('You recovered 40 HP and 10 Oxygen')
                    HP = HP +40
                    TANK = TANK +10
                input('Hit Enter')
        if password == 'e' or password == 'E':
            if TANK >= 1:
               print('You exit the ship...')
               #(3)
               AREA = AREA +1
            if TANK < 1:
                print('You can\'t exit if you don\'t have enough Oxygen!')
            
        if password == 's' or password == 'S':
            print('Water', WATER)
            print('SHIP OXYGEN', OXY, '%')
            print('SUIT OXYGEN', TANK, '%')
            print('HP', HP)
            print('TIME', HOUR)
            
        if password == '8':
            while 0 == 0:
                SSCRAP = SSCRAP
                SSALT = SSALT
                SEGG = SEGG
                SSLIME = SSLIME
                SMEAT = SMEAT
                SELEC = SELEC
                SRAT = SRAT 
                SMED = SMED
                SPILL = SPILL
                
                print('What do you want to take?')
                print('1.) Scrap Metal :', SSCRAP)
                print('2.) Salt', SSALT)
                print('3.) Frag Eggs', SEGG)
                print('4.) Frag Slime', SSLIME)
                print('5.) Frag Meat', SMEAT)
                print('6.) Electronics', SELEC)
                print('7.) Rations', SRAT)
                print('8.) Medkits', SMED)
                print('9.) Pills', SPILL)
               
                print('e.) Exit')
                A = input(':')
                if A == 'E' or A == 'e':
                    break
                if A == '1' and SCRAP >= 1:
                    SSCRAP = SSCRAP -1
                    SCRAP = SCRAP +1
                if A == '2' and SALT >= 1:
                    SSALT = SSALT -1
                    SALT = SALT +1
                if A == '3' and EGG >= 1:
                    SEGG = SEGG -1
                    EGG = EGG +1
                if A == '4' and SLIME >= 1:
                    SSLIME = SSLIME -1
                    SLIME = SLIME +1
                if A == '5' and MEAT >= 1:
                    SMEAT = SMEAT -1
                    MEAT = MEAT +1
                if A == '6' and ELEC >= 1:
                    SELEC = SELEC -1
                    ELEC = ELEC +1
                if A == '7' and RAT >= 1:
                    SRAT = SRAT -1
                    RAT = RAT +1
                if A == '8' and MED >= 1:
                    SMED = SMED -1
                    MED = MED +1
                if A == '9' and PILL >= 1:
                    SPILL = SPILL -1
                    PILL = PILL +1
                
        if password == '7' and OXY >= 11:
            print('Filling 10 % more...')
            #(3)
            OXY = OXY -10
            TANK = TANK +10
            input('Hit Enter')
          
          
        
                      
                          
                  
        if password == '6':
            print('You rest for 6 hours...')
            HOUR = HOUR +6
            time.sleep(2)
            print('It is now', HOUR)
            
            #(2.5)
            if RAT < 1 and MEAT < 1 and EGG < 1:
                print('You don\'t have any food...\nYou lose 25 HP')
                HP = HP -25
            if WATER < 1:
                print('You have no Water!')
                print('You lost 10 HP')
                HP = HP -10
            if WATER >= 1:
                print('You have some water with your your meal!')
                WATER = WATER -1
            if RAT < 1 and MEAT >= 1 and EGG < 1:
                print('You eat some meat for your meal.')
                MEAT = MEAT -1
                input('Hit Enter')
                print('You wake up fully rested!')
                print('HP is at maximum!')
                HP = 100
                DAY = DAY +1
                input('Hit Enter')
            if RAT < 1 and MEAT < 1 and EGG >= 1:
                print('You eat an egg for your meal.')
                EGG = EGG -1
                input('Hit Enter')
                print('You wake up fully rested!')
                print('HP is at maximum!')
                HP = 100
                DAY = DAY +1
                input('Hit Enter')
            if RAT >= 1 and MEAT < 1 and EGG < 1:
                print('You eat a ration for your meal.')
                RAT = RAT -1
                input('Hit Enter')
                print('You wake up fully rested!')
                print('HP is at maximum!')
                HP = 100
                DAY = DAY +1
                input('Hit Enter')
            
            
            
        if password == 'i' or password == 'I':
            print('SCRAP', SCRAP)
            print('SALT', SALT)
            print('EGGS', EGG)
            print('SLIME', SLIME)
            print('MEAT', MEAT)
            print('ELECTRONICS', ELEC)
            print('RATIONS', RAT)
            print('MEDKITS', MED)
            print('PILLS', PILL)
            print('FUEL', FUEL)
            print('REPAIR KITS', REPAIR)
            input('Hit Enter')
            for x in range(0, 100):
                print('')
        if password == '4':
            while 0 == 0:
                print('Break Down an Item')
                print('1.) RATION      : 3 MEAT')
                print('2.) RATION      : 3 EGG')
                print('3.) PILL        : 1 SALT 1 SLIME')
                
                print('4.) SHIP REPAIR : 10 SCRAP 20 ELECTRONIC')
                print(' YOU CAN\'T EXTRACT FRAG FARMS!')
                print('5.) FUEL        : 3 SLIME')
                print('e.) Exit')
                A = input(':')
                if A == 'e' or A == 'E':
                    break
                if A == '1' and RAT >= 1:
                    print('Got 3 Meat')
                    MEAT = MEAT +3
                    RAT = RAT -1
                if A == '2' and RAT >= 1:
                    print('Got 3 Eggs')
                    EGG = EGG +3
                    RAT = RAT -1
                if A == '3' and PILL >= 1:
                    print('Got 1 Salt and 1 Slime')
                    SLIME = SLIME +1
                    SALT = SALT +1
                    PILL = PILL -1
                  
               
                if A == '4' and REPAIR >= 1:
                    print('Got 10 Scrap and 20 Electronics')
                    SCRAP = SCRAP +10
                    ELEC = ELEC +20
                    REPAIR = REPAIR -1
                
                if A == '5' and FUEL >= 1:
                    print('Got 3 Slime')
                    SLIME = SLIME +3
                    FUEL = FUEL -1
        if password == '1':
            for x in range(0, 100):
              print('')
        if password == '5':
            if REPAIR < 3 and FUEL < 50:
                print('You decide to try to lift off.')
                input('Hit Enter')
                print('You ignite the thrusters...')
                #(2.5)
                print('You fly into the sky, where your ship starts rattling')
                input('Hit Enter')
                print('Soon the ship bursts into flames!')
                #(2.5)
                print('YOU SHOULD PREPARE NEXT TIME!')
                #(3)
                HP = 0
            if REPAIR >= 3 and FUEL >= 50:
                print('After a long,', DAY, 'days of prep, you are ready to take off.')
                input('Hit Enter')
                print('You ignite the thrusters...')
                time.sleep(2.5)
                print('// ACCELERATING...')
                time.sleep(2.5)#(2.5)
                print('// RE-SYNTHESIZING FUEL...')
               
                time.sleep(2.5)#(2.5)
                print('You take a moment to look upon your humble, extraterrestrial abode.')
                time.sleep(2.5)#(2.5)
                print('// 1 MILE')
                time.sleep(2.5)#(2)
                print('// 5 MILES')
                time.sleep(2.5)#(2)
                print('// 10 MILES')
                time.sleep(2.5)#(3)
                print('// ENTERING VACUUM')
                time.sleep(3.5)#(5)
                print('Soon you find yourself docking with the remains of your main-ship...')
                input('Hit Enter')
                print('// DOCKING WITH "SUPER-NOVA"')
                time.sleep(2.5)#(3)
                print('###############CREDITS###############')
                time.sleep(2.5)#(2)     
                print('#  CARTER STUTZMAN                  #')
                time.sleep(2.5)#(2)     
                print('#                  LEAD PROGRAMMER  #')
                time.sleep(2.5)#(2)     
                print('#          PYTHON COMPUTERS         #')
                time.sleep(2.5)#(2)
                print('#          PY     COM               #')
                time.sleep(2.5)#(2)
                print('#####################################')
        if password == '3':
            while 0 == 0:
                print('1.) RATION         : 3 MEAT')
                print('2.) RATION         : 3 EGG')
                print('3.) PILL           : 1 SALT 1 SLIME')
                print('4.) ATK+25%        : 5 SCRAP 1 ELECTRONIC')
                print('5.) ATK+50%        : 7 SCRAP 3 ELECTRONIC')
                print('6.) SHIP REPAIR    : 10 SCRAP 20 ELECTRONIC')
                print('7.) FRAG FARM      : 10 SCRAP')
                print('8.) MEDKIT         : 5 PILLS')
                print('9.) FUEL           : 1 SLIME')
                print('10.) FUEL          : 3 MEAT')
                print('11.) OXYGEN        : 1 WATER')
                print('12.) OXYGEN        : 3 SLIME')
                print('13.) WATER         : 1 OXYGEN')
                print('14.) WATER         : 3 SLIME')
                print('e.) Exit')
                A = input(':')
                if A == 'e' or A == 'E':
                    break
                if A == '14' and SLIME >= 3:
                    print('Synthesized a Unit of Water')
                    SLIME = SLIME -3
                    WATER = WATER +1
                if A == '13' and OXY >= 1:
                    print('Synthesized a Unit of Water')
                    OXY = OXY -1
                    WATER = WATER +1
                    
                if A == '9' and SLIME >= 1:
                    print('Synthesized a Unit of Fuel')
                    SLIME = SLIME -1
                    FUEL = FUEL +1
                if A == '10' and MEAT >= 3:
                    print('Synthesized a Unit of Fuel')
                    MEAT = MEAT -3
                    FUEL = FUEL +1
                if A == '11' and WATER >= 1:
                    print('Synthesized a Unit of Oxygen')
                    WATER = WATER -1
                    OXY = OXY +1
                if A == '12' and SLIME >= 3:
                    print('Synthesized a Unit of Oxygen')
                    SLIME = SLIME -1
                    OXY = OXY +1
                
                if A == '8' and PILLS >= 5:
                    print('Synthesized a Medkit')
                    PILL = PILL -5
                    MED = MED +1
                if A == '1' and MEAT >= 3:
                    print('Synthesized a Ration')
                    MEAT = MEAT -3
                    RAT = RAT +1
                if A == '2' and EGG >= 3:
                    print('Synthesized a Ration')
                    EGG = EGG -3
                    RAT = RAT +1
                if A == '3' and SALT >= 1 and SLIME >= 1:
                    print('Synthesized a Pill')
                    SLIME = SLIME -1
                    SALT = SALT -1
                    PILL = PILL +1

                if A == '4' and SCRAP >= 5 and ELEC >= 1:
                    print('Synthesized an ATK +25')
                    SCRAP = SCRAP -5
                    ELEC = ELEC -1
                    
                    HM.append(1)
                if A == '5' and SCRAP >= 7 and ELEC >= 3:
                    print('Synthesized an ATK +50')
                    SCRAP = SCRAP -7
                    ELEC = ELEC -3
                    
                    HM.append(1)
                    HM.append(1)
                if A == '6' and SCRAP >= 25 and ELEC >= 25:
                    print('Synthesized a Ship Repair Kit')
                    SCRAP = SCRAP -10
                    ELEC = ELEC -20
                    REPAIR = REPAIR +1
                if A == '7' and SCRAP >= 10:
                    print('Synthesized a Frag Farm')
                    SCRAP = SCRAP -10
                    FARM = FARM +1
                if A == '8' and PILL >= 5:
                    print('Synthesized a Medkit')
                    MED = MED +1
                    PILL = PILL -5




        if password == '2':
            while 0 == 0:
                print('What do you want to store?')
                print('1.) Scrap Metal :', SCRAP)
                print('2.) Salt', SALT)
                print('3.) Frag Eggs', EGG)
                print('4.) Frag Slime', SLIME)
                print('5.) Frag Meat', MEAT)
                print('6.) Electronics', ELEC)
                print('7.) Rations', RAT)
                print('8.) Medkits', MED)
                print('9.) Pills', PILL)
                print('e.) Exit')
                A = input(':')
                if A == 'E' or A == 'e':
                    break
                if A == '1' and SCRAP >= 1:
                    SSCRAP = SSCRAP +1
                    SCRAP = SCRAP -1
                    
                if A == '2' and SALT >= 1:
                    SSALT = SSALT +1
                    SALT = SALT -1
                if A == '3' and EGG >= 1:
                    SSCRAP = SEGG +1
                    EGG = EGG -1
                if A == '4' and SLIME >= 1:
                    SSLIME = SSLIME +1
                    SLIME = SLIME -1
                    
                if A == '5' and MEAT >= 1:
                    SMEAT = SMEAT +1
                    MEAT = MEAT -1
                if A == '6' and ELEC >= 1:
                    SELEC = SELEC +1
                    ELEC = ELEC -1
                if A == '7' and RAT >= 1:
                    SRAT = SRAT +1
                    RAT = RAT -1
                if A == '8' and MED >= 1:
                    SMED = SMED +1
                    MED = MED -1
                if A == '9' and PILL >= 1:
                    SPILL = SPILL +1
                    PILL = PILL -1
                    

I've had this for about a week now, and I'm working on a follow up-game, Planet X Journey.
Planet X Journey features multiple planets and base building. It is loosely based on "No Man's Sky" but simplified into text form, and reduced to 5 planets. Thanks for reading this, bye.
Reply
#20
(Jan-31-2018, 10:34 PM)PKMindBlow Wrote: I've had this for about a week now, and I'm working on a follow up-game, Planet X Journey.
One bit of well-intentioned advice - before you start next game, put some effort in refactoring your current code. That kind of code style, with endless if blocks, endless prints, etc. is ridiculous. Learn how to use proper data structures, functions, classes, etc. and implement these in your code.
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,885 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Using classes for room movement (text game) Lawr3y 3 6,592 Aug-20-2019, 12:40 AM
Last Post: Lawr3y
  Text Based Game DuaneJack 3 3,550 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