Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm going to attempt to make a game in python
#1
I changed the game and this is all I bothered to write
Code:
print("*Game Notice:Please turn off caps before starting*")

print("Hello user 935")
print("Press 1 or 2 to ask a question...")
q1 = raw_input("1 Who are you?  2 Where am I? :")
if q1 == "1":
    print("We will get to that later on...")
if q1 == "2":
    print("You are in a top secret testing faciltiy")
print("Ask another question...")
q2 = raw_input("1 Who are you?  2 Where am I? :")
if q2 == "1":
    print("We will get to that later on...")
if q2 == "2":
    print("You are in a top secret testing facility")
print("That is all the questions for now.")
print("Well uh what was it agian? Well lets call you by your name.")
name = raw_input("Please Enter you name here  :")
print("Welcome "+name)
print("1: What am I here for?")
print("2: How do I get out of here?")
q3 = raw_input("Please select one of these question by the number  :")
if q3 == "1":
    print("You are here to complete a series of tests.")
if q3 == "2":
    print("By completing a series of tests.")
print("Ask another question...")
print("1: What am I here for?")
print("2: How do I get out of here?")
q3 = raw_input("Please select one of these question by the number  :")
if q3 == "1":
    print("You are here to complete a series of tests.")
if q3 == "2":
    print("By completing a series of tests.")
print ("you can ask two more questions before we move on to your tests")
q4 = raw_input("1: Why me?  2: Will these tests be dangerous?")
if q4 == "1":
    print("Because you are far more than the average human")
if q4 == "2":
    print("You will see as the time comes")
print("Ask another question...")
q4 = raw_input("1: Why me?  2: Will these tests be dangerous? :")
if q4 == "1":
    print("Because you are far more than the average human")
if q4 == "2":
    print("You will see as the time comes")

print("Now lets move on to your first test")
print("This test infact will be dangerous, "+name)
print("You must make your way from this platform to the Platform ahead of you")
q5 = raw_input("1: How do I do that?  :")
if q5 == "1":
    print("I hope you find out soon you have 10 minutes")
jump1 = raw_input("1: Jump to platfrom to the right  2: Jump to platform to the left  :")
if jump1 == "1":
    print("Good job you made it")
if jump1 == "2":
    print("Good job you made it")
print("The next jump takes more skill")
jump2 = raw_input("1:Jump to rusty platform 1 1/2 feet away  2:Jump to new platform 3 feet away :")
if jump == "1":
    print("You have failed")
if jump2 == "2":
    print("Congardulations "+name)
print("Now there is one last jump")
jump3 = raw_input("1: Jump to Finish platform 2: Jump to Ladder")
if jump3 == "1":
    print("You are done with your first test"+name)
if jump3 == "2":
    print("The ladder slips into the darkness below you,You have failed")
print("User 583 completed this test perfectly lets see if you can do the same "+name)
print("You may have noticed that if you fail you don't die...")
q6 = raw_input("1: How does that work?")
if q6 == "1":
    print("If you don't mind lets move on to your next test")
q7 = raw_input("1: No, tell me now!  2:Okay i'm ready")
if q7 == "1":
    print("I said lets move on to your next test "+name)
if q7 == "2":
    print("Thank you")
print("583 had few problems with the next test lets hope you're the same")
print("Before you woke up you had some injections...")
q8 = raw_input("1: What kind of injections?")
if q8 == "1":
    print("If you would please let me finish "+name)
print("Now these injections may have changed your memory...")
print("So please tell me every other letter of the alphabet until you reach 'H' seperate them with commas please ")
q9 =raw_input(": ")
if q9 == "a,c,e,g,i,h":
    print("It seems that you are far more exceptional")
else:"Please retry"
q9 =raw_input(": ")
if q9 == "a,c,e,g,i,h":
    print("Lets move on...")
q10 = raw_input("1: Tell my why I didn't die when I failed. :")
if q10 == "1":
    print("Well okay then the fact is...you are dead "+name)
q11 = raw_input("1: WHAT? :")
print("Well not dead 100% your body is dead body your mind isn't")
q12 = raw_input("1: Well then how am I completing these tests?")
if q12 == "1":
    print("They are computer generated they don't exist in the real world")
print("Also, after you have completed these tests you will be sent back home and you will forget this all ever happened")
print("Now you should see a door to your right...This is your next test")
q13 = raw_input("1: Open door")
print("What you see is New York City")
q14 = raw_input("1: How?  2: What now?")
if q14 == "1":
    print("Like I said, all computer generated")
if q14 == "2":
    print("You must get to the top of the tower in front of you")
print("Choose another question...")
q14 = raw_input("1: How?  2: What now?")
if q14 == "1":
    print("Like I said, all computer generated")
if q14 == "2":
    print("You must get to the top of the tower in front of you")
Reply
#2
I am not a fan of python
Reply
#3
Code:
import sys, time, random, math

def died():
    sys.exit('You have died!\nGame over!')

print("Welcome to Kieron's Text-Based Python Game.")
time.sleep(2)
name = raw_input("???: What is your name? ")
print("???: So you are " + name + ".")
time.sleep(1)
print("???: Perfect. If you have any questions, don't refrain from asking.")
time.sleep(1)
print("1 - Who are you?\n2 - What is this game?\n3 - I have no questions")
qa1 = int(raw_input('Type one of the above: '))
if qa1 == 1:
    print("???: In this world, I am Kieron Dodge.")
elif qa1 == 2:
    print("???: This is a text-based war game, based in the Year 2018, it includes most of the people I know in it.")
elif qa1 == 3:
    print("???: Very well, then.")
else:
    print("???: I assume you want to continue.")
print("Kieron: I may have told you this already but I am Kieron or Kieron Dodge, a much less greater name, and a war has broke out on an island called Hatton in the Year 2018.")
time.sleep(6)
print("Kieron: You will be serving as a soldier in a special force of Hatton named Hippo Squad.")
time.sleep(3)
print(name + ": Hippo Squad?")
time.sleep(3)
print("Kieron: Yes, the special force faction of the Army Of Hatton. There are a few members in it, Col. 'Nat' Birch, SSgt. Kieron Dodge, Sgt. Alex Thorpe, Sgt. Wojtech Grodecki, Sgt. Adam Parret and Sgt. Mitchell Frisby.")
time.sleep(6)
print(name + ": Who are these people?")
time.sleep(3)
print("Kieron: The best youngest soldiers of the Hatton Army. But now, time is running out, it's time for you to join them. See you soon...")
time.sleep(2)
print(name + ": Wait! I still have more to ask!")
time.sleep(4)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 04:31\n" + name + "\n'War begins'")
time.sleep(2)
print("Bodyguard: " + name + ", welcome to Hippo Squad, where the youngest and strongest are put into. You've been serving for Hatton since you were 11, correct?")
time.sleep(5)
qa2 = int(raw_input("1 - Yes\n2 - No\nYour answer(by number): "))
time.sleep(1)
if qa2 == 1:
    print("Bodyguard: Just as I thought, just as talented as the others.")
elif qa2 == 2:
    print("Bodyguard: Maybe I just got the wrong impression.")
else:
    print("Bodyguard: Fine with me.")
time.sleep(5)
print("Bodyguard: We're at the conference, sir. Best of luck.")
dc1 = int(raw_input("1 - Go inside\n2 - Turn back\nYour answer(by number): "))
if dc1 == 1:
    print("You go inside.")
elif dc1 == 2:
    print("Bodyguard: Wow, sir! Where ya goin'?")
    print("You go inside.")
else:
    print("You go inside.")
print("Col. Birch: Here's our new recruit, and it's about time, take a seat.")
dc2 = int(raw_input("1 - Sit next to Sgt. Pedrick\n2 - Sit next to Sgt. Frisby\n3 - Sit next to SSgt. Dodge\nYour answer(by number): "))
if dc2 == 1:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
elif dc2 == 2:
    print("Sgt. Frisby: I've heard good things about you, " + name + ". You just better live up to those expectations or else...")
elif dc2 == 3:
    print("SSgt. Dodge: The cow thinks she can call me weak, don't see 'er shooting her way around. Oh, sorry, I was talking to myself, " + name + " is it? Sit down and pay attention.")
else:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
time.sleep(5)
print("Col. Birch: As most of you probably know, we are in grave danger of war with my home country of Sumantrina. They built themselves into an electrical state in 19 hours and have many nukes at stake.")
time.sleep(5)
print("Col. Birch: If we are attacked, we cannot lose A Block or C Block or else we're finished.")
time.sleep(5)
print("*A hatton soldier charged in*Soldier: Colonel! We're under attack! And I'm talking atleast 2000 soldiers out there, we can't handle it!")
time.sleep(5)
print("Col. Birch: Put yourself together! Hippo Squad, let's go! " + name + ", you're on Sniper duty, Pedrick get your plane, the rest of you, with me!")
time.sleep(5)
print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 06:22\n" + name + "\n'Sniper 101'")
print("Sgt. Pedrick: Alright, " + name + ", be grateful I brought you, now get off and do what you are supposed to.")
time.sleep(3)
dc3 = int(raw_input("1 - Jump\n2 - Stay\nYour answer(by number): "))
if dc3 == 1:
    print("You jump into C Block.")
elif dc3 == 2:
    print("Sgt. Pedrick pushes you.")
else:
    print("You jump into C Block.")
time.sleep(5)
ammo1 = 20
mag1 = 5
killed1 = 0
health1 = 100
while ammo1 > 0:
    time.sleep(5)
    if ammo1 > 0:
        break
    print("Col. Birch: " + name +", you are clear to shoot!")
    print("Your ammo: ")
    print(ammo1)
    print("Your shots left: ")
    print(mag1)
    print("Enemies killed: ")
    print(killed1)
    print("Your health: ")
    print(health1)
    st1 = int(raw_input("1 - Shoot\n2 - Reload\nYour answer(by number): "))
    enemyshoot1 = random.randrange(0, 3)
    enemydamage1 = random.randrange(1, 10)
    if enemyshoot1 == 0:
        print("The enemy missed you!")
    else:
        print("The enemy hit you!")
        health1 = health1 - enemydamage1
    if st1 == 1:
        if mag1 == 0:
            print("You reload")
            mag1 = 5
            ammo1 = ammo1 - 5
        else:
            shothit1 = random.randrange(0, 3)
            if shothit1 == 0:
                print("Shot missed!")
                mag1 = mag1 - 1
            elif shothit1 == 1:
                print("Shot hit!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
            elif shothit1 == 2:
                print("BOOM! Headshot!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
    elif st1 == 2:
        if mag1 > 0:
            print("Mag not at 0, turn missed")
        else:
            print("Fully loaded!")
            mag1 = 5
            ammo1 = ammo1 - 5
    else:
        print("TURN MISSED!")
print(name + ": Sir! I'm all out of ammo!")
time.sleep(5)
print("Col. Birch: I understand the situation, standby while I try to get Pedrick.")
time.sleep(10)
print("Col. Birch: She says she'll be on the rooftops, but she is taking heavy fire, so hurry up. Birch out.")
time.sleep(5)
dc4 = int(raw_input("1 - Go through the door\n2 - Jump out the window and hang on to the ledges\nYour answer(by number): "))
if dc4 == 1:
    print("You go through the door")
    dc4a = int(raw_input("1 - Go left\n2 - Go right\nYour answer(by number): "))
    if dc4a == 1:
        print("You go left")
        time.sleep(5)
        rubble1 = random.randrange(1, 3)
        if rubble1 == 1:
            print("You get hit by rubble!")
            health1 = health1 - 5
            print("Health: ")
            print(health1)
        else:
            print("You avoid the rubble")
        time.sleep(5)
        dc4aa = int(raw_input("1 - Go up\n2 - Breach classroom\nYour answer(by number): "))
        if dc4aa == 1:
            print("You get to the rooftops.")
            time.sleep(5)
            print("Sgt. Pedrick: I see you, " + name + "! Run!")
            time.sleep(5)
            print("You run over to Pedrick's Helicopter and jump!")
            jumpcatch1 = random.randrange(0, 4)
            if jumpcatch1 == 0:
                print("You missed the helicopter!")
                died()
            else:
                print("Col. Birch: Good job, rookie.")
        else:
            print("You breach the classroom")
            breachclass1 = random.randrange(0, 3)
            if breachclass1 != 0:
                print("Breached classroom successfully!")
                time.sleep(5)
                print("Sgt. Pedrick: Looks like I can pick you up from here")
                time.sleep(5)
                print("Col. Birch: Good job, rookie.")
            else:
                print("You died!")
                died()
    else:
        if dc4a == 2:
            print("You go right")
            time.sleep(5)
            rubble2 = random.randrange(1, 3)
            if rubble2 == 1:
                print("You get hit by rubble!")
                health1 = health1 - 5
                print("Health: ")
                print(health1)
            else:
                print("You avoid the rubble")
            time.sleep(5)
            dc4ab = int(raw_input("1 - Climb handrails\n2 - Jump out the window\nYour answer(by number): "))
            if dc4ab == 1:
                balance1 = random.randrange(0, 2)
                if balance1 == 0:
                    print("You missed the handrails!")
                    died()
                else:
                    print("You climb the handrails to the rooftops")
                    time.sleep(5)
                    print("Sgt. Pedrick: It's about time, " + name + "! Hurry it up, run!")
                    time.sleep(5)
                    print("You run over to Pedrick's helicopter and jump!")
                    jumpcatch2 == random.randrange(0, 4)
                    if jumpcatch2 == 0:
                        print("You missed the helicopter!")
                        died()
                    else:
                        print("Col. Birch: Good job, rookie.")
else:
    print("There were no ledges, so you fell to your death.")
    died()
print("Level Completed.")
print("Score: ")
print(health1 * killed1 / 2)
time.sleep(5)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 11th 2018\nTime: 12:44\n" + name + "\n'Railroads'")
time.sleep(5)
print("Col. Birch: Remeber now, Dodge?")
time.sleep(5)
print("SSgt. Dodge: Yes, sir. Now what?")
time.sleep(5)
print("Col Birch: Well, we traced Sgt. Thorpe, an absent member, to an enemy camp near the edge of Hatton. It is connected by railroads.")

A game in making also.
Reply
#4
(12-30-2011, 02:25 PM)Mustachio Wrote:
Code:
import sys, time, random, math

def died():
    sys.exit('You have died!\nGame over!')

print("Welcome to Kieron's Text-Based Python Game.")
time.sleep(2)
name = raw_input("???: What is your name? ")
print("???: So you are " + name + ".")
time.sleep(1)
print("???: Perfect. If you have any questions, don't refrain from asking.")
time.sleep(1)
print("1 - Who are you?\n2 - What is this game?\n3 - I have no questions")
qa1 = int(raw_input('Type one of the above: '))
if qa1 == 1:
    print("???: In this world, I am Kieron Dodge.")
elif qa1 == 2:
    print("???: This is a text-based war game, based in the Year 2018, it includes most of the people I know in it.")
elif qa1 == 3:
    print("???: Very well, then.")
else:
    print("???: I assume you want to continue.")
print("Kieron: I may have told you this already but I am Kieron or Kieron Dodge, a much less greater name, and a war has broke out on an island called Hatton in the Year 2018.")
time.sleep(6)
print("Kieron: You will be serving as a soldier in a special force of Hatton named Hippo Squad.")
time.sleep(3)
print(name + ": Hippo Squad?")
time.sleep(3)
print("Kieron: Yes, the special force faction of the Army Of Hatton. There are a few members in it, Col. 'Nat' Birch, SSgt. Kieron Dodge, Sgt. Alex Thorpe, Sgt. Wojtech Grodecki, Sgt. Adam Parret and Sgt. Mitchell Frisby.")
time.sleep(6)
print(name + ": Who are these people?")
time.sleep(3)
print("Kieron: The best youngest soldiers of the Hatton Army. But now, time is running out, it's time for you to join them. See you soon...")
time.sleep(2)
print(name + ": Wait! I still have more to ask!")
time.sleep(4)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 04:31\n" + name + "\n'War begins'")
time.sleep(2)
print("Bodyguard: " + name + ", welcome to Hippo Squad, where the youngest and strongest are put into. You've been serving for Hatton since you were 11, correct?")
time.sleep(5)
qa2 = int(raw_input("1 - Yes\n2 - No\nYour answer(by number): "))
time.sleep(1)
if qa2 == 1:
    print("Bodyguard: Just as I thought, just as talented as the others.")
elif qa2 == 2:
    print("Bodyguard: Maybe I just got the wrong impression.")
else:
    print("Bodyguard: Fine with me.")
time.sleep(5)
print("Bodyguard: We're at the conference, sir. Best of luck.")
dc1 = int(raw_input("1 - Go inside\n2 - Turn back\nYour answer(by number): "))
if dc1 == 1:
    print("You go inside.")
elif dc1 == 2:
    print("Bodyguard: Wow, sir! Where ya goin'?")
    print("You go inside.")
else:
    print("You go inside.")
print("Col. Birch: Here's our new recruit, and it's about time, take a seat.")
dc2 = int(raw_input("1 - Sit next to Sgt. Pedrick\n2 - Sit next to Sgt. Frisby\n3 - Sit next to SSgt. Dodge\nYour answer(by number): "))
if dc2 == 1:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
elif dc2 == 2:
    print("Sgt. Frisby: I've heard good things about you, " + name + ". You just better live up to those expectations or else...")
elif dc2 == 3:
    print("SSgt. Dodge: The cow thinks she can call me weak, don't see 'er shooting her way around. Oh, sorry, I was talking to myself, " + name + " is it? Sit down and pay attention.")
else:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
time.sleep(5)
print("Col. Birch: As most of you probably know, we are in grave danger of war with my home country of Sumantrina. They built themselves into an electrical state in 19 hours and have many nukes at stake.")
time.sleep(5)
print("Col. Birch: If we are attacked, we cannot lose A Block or C Block or else we're finished.")
time.sleep(5)
print("*A hatton soldier charged in*Soldier: Colonel! We're under attack! And I'm talking atleast 2000 soldiers out there, we can't handle it!")
time.sleep(5)
print("Col. Birch: Put yourself together! Hippo Squad, let's go! " + name + ", you're on Sniper duty, Pedrick get your plane, the rest of you, with me!")
time.sleep(5)
print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 06:22\n" + name + "\n'Sniper 101'")
print("Sgt. Pedrick: Alright, " + name + ", be grateful I brought you, now get off and do what you are supposed to.")
time.sleep(3)
dc3 = int(raw_input("1 - Jump\n2 - Stay\nYour answer(by number): "))
if dc3 == 1:
    print("You jump into C Block.")
elif dc3 == 2:
    print("Sgt. Pedrick pushes you.")
else:
    print("You jump into C Block.")
time.sleep(5)
ammo1 = 20
mag1 = 5
killed1 = 0
health1 = 100
while ammo1 > 0:
    time.sleep(5)
    if ammo1 > 0:
        break
    print("Col. Birch: " + name +", you are clear to shoot!")
    print("Your ammo: ")
    print(ammo1)
    print("Your shots left: ")
    print(mag1)
    print("Enemies killed: ")
    print(killed1)
    print("Your health: ")
    print(health1)
    st1 = int(raw_input("1 - Shoot\n2 - Reload\nYour answer(by number): "))
    enemyshoot1 = random.randrange(0, 3)
    enemydamage1 = random.randrange(1, 10)
    if enemyshoot1 == 0:
        print("The enemy missed you!")
    else:
        print("The enemy hit you!")
        health1 = health1 - enemydamage1
    if st1 == 1:
        if mag1 == 0:
            print("You reload")
            mag1 = 5
            ammo1 = ammo1 - 5
        else:
            shothit1 = random.randrange(0, 3)
            if shothit1 == 0:
                print("Shot missed!")
                mag1 = mag1 - 1
            elif shothit1 == 1:
                print("Shot hit!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
            elif shothit1 == 2:
                print("BOOM! Headshot!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
    elif st1 == 2:
        if mag1 > 0:
            print("Mag not at 0, turn missed")
        else:
            print("Fully loaded!")
            mag1 = 5
            ammo1 = ammo1 - 5
    else:
        print("TURN MISSED!")
print(name + ": Sir! I'm all out of ammo!")
time.sleep(5)
print("Col. Birch: I understand the situation, standby while I try to get Pedrick.")
time.sleep(10)
print("Col. Birch: She says she'll be on the rooftops, but she is taking heavy fire, so hurry up. Birch out.")
time.sleep(5)
dc4 = int(raw_input("1 - Go through the door\n2 - Jump out the window and hang on to the ledges\nYour answer(by number): "))
if dc4 == 1:
    print("You go through the door")
    dc4a = int(raw_input("1 - Go left\n2 - Go right\nYour answer(by number): "))
    if dc4a == 1:
        print("You go left")
        time.sleep(5)
        rubble1 = random.randrange(1, 3)
        if rubble1 == 1:
            print("You get hit by rubble!")
            health1 = health1 - 5
            print("Health: ")
            print(health1)
        else:
            print("You avoid the rubble")
        time.sleep(5)
        dc4aa = int(raw_input("1 - Go up\n2 - Breach classroom\nYour answer(by number): "))
        if dc4aa == 1:
            print("You get to the rooftops.")
            time.sleep(5)
            print("Sgt. Pedrick: I see you, " + name + "! Run!")
            time.sleep(5)
            print("You run over to Pedrick's Helicopter and jump!")
            jumpcatch1 = random.randrange(0, 4)
            if jumpcatch1 == 0:
                print("You missed the helicopter!")
                died()
            else:
                print("Col. Birch: Good job, rookie.")
        else:
            print("You breach the classroom")
            breachclass1 = random.randrange(0, 3)
            if breachclass1 != 0:
                print("Breached classroom successfully!")
                time.sleep(5)
                print("Sgt. Pedrick: Looks like I can pick you up from here")
                time.sleep(5)
                print("Col. Birch: Good job, rookie.")
            else:
                print("You died!")
                died()
    else:
        if dc4a == 2:
            print("You go right")
            time.sleep(5)
            rubble2 = random.randrange(1, 3)
            if rubble2 == 1:
                print("You get hit by rubble!")
                health1 = health1 - 5
                print("Health: ")
                print(health1)
            else:
                print("You avoid the rubble")
            time.sleep(5)
            dc4ab = int(raw_input("1 - Climb handrails\n2 - Jump out the window\nYour answer(by number): "))
            if dc4ab == 1:
                balance1 = random.randrange(0, 2)
                if balance1 == 0:
                    print("You missed the handrails!")
                    died()
                else:
                    print("You climb the handrails to the rooftops")
                    time.sleep(5)
                    print("Sgt. Pedrick: It's about time, " + name + "! Hurry it up, run!")
                    time.sleep(5)
                    print("You run over to Pedrick's helicopter and jump!")
                    jumpcatch2 == random.randrange(0, 4)
                    if jumpcatch2 == 0:
                        print("You missed the helicopter!")
                        died()
                    else:
                        print("Col. Birch: Good job, rookie.")
else:
    print("There were no ledges, so you fell to your death.")
    died()
print("Level Completed.")
print("Score: ")
print(health1 * killed1 / 2)
time.sleep(5)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 11th 2018\nTime: 12:44\n" + name + "\n'Railroads'")
time.sleep(5)
print("Col. Birch: Remeber now, Dodge?")
time.sleep(5)
print("SSgt. Dodge: Yes, sir. Now what?")
time.sleep(5)
print("Col Birch: Well, we traced Sgt. Thorpe, an absent member, to an enemy camp near the edge of Hatton. It is connected by railroads.")

A game in making also.

How long did it take you to write all of that?
Reply
#5
(12-30-2011, 03:22 PM)Paradox Wrote:
(12-30-2011, 02:25 PM)Mustachio Wrote:
Code:
import sys, time, random, math

def died():
    sys.exit('You have died!\nGame over!')

print("Welcome to Kieron's Text-Based Python Game.")
time.sleep(2)
name = raw_input("???: What is your name? ")
print("???: So you are " + name + ".")
time.sleep(1)
print("???: Perfect. If you have any questions, don't refrain from asking.")
time.sleep(1)
print("1 - Who are you?\n2 - What is this game?\n3 - I have no questions")
qa1 = int(raw_input('Type one of the above: '))
if qa1 == 1:
    print("???: In this world, I am Kieron Dodge.")
elif qa1 == 2:
    print("???: This is a text-based war game, based in the Year 2018, it includes most of the people I know in it.")
elif qa1 == 3:
    print("???: Very well, then.")
else:
    print("???: I assume you want to continue.")
print("Kieron: I may have told you this already but I am Kieron or Kieron Dodge, a much less greater name, and a war has broke out on an island called Hatton in the Year 2018.")
time.sleep(6)
print("Kieron: You will be serving as a soldier in a special force of Hatton named Hippo Squad.")
time.sleep(3)
print(name + ": Hippo Squad?")
time.sleep(3)
print("Kieron: Yes, the special force faction of the Army Of Hatton. There are a few members in it, Col. 'Nat' Birch, SSgt. Kieron Dodge, Sgt. Alex Thorpe, Sgt. Wojtech Grodecki, Sgt. Adam Parret and Sgt. Mitchell Frisby.")
time.sleep(6)
print(name + ": Who are these people?")
time.sleep(3)
print("Kieron: The best youngest soldiers of the Hatton Army. But now, time is running out, it's time for you to join them. See you soon...")
time.sleep(2)
print(name + ": Wait! I still have more to ask!")
time.sleep(4)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 04:31\n" + name + "\n'War begins'")
time.sleep(2)
print("Bodyguard: " + name + ", welcome to Hippo Squad, where the youngest and strongest are put into. You've been serving for Hatton since you were 11, correct?")
time.sleep(5)
qa2 = int(raw_input("1 - Yes\n2 - No\nYour answer(by number): "))
time.sleep(1)
if qa2 == 1:
    print("Bodyguard: Just as I thought, just as talented as the others.")
elif qa2 == 2:
    print("Bodyguard: Maybe I just got the wrong impression.")
else:
    print("Bodyguard: Fine with me.")
time.sleep(5)
print("Bodyguard: We're at the conference, sir. Best of luck.")
dc1 = int(raw_input("1 - Go inside\n2 - Turn back\nYour answer(by number): "))
if dc1 == 1:
    print("You go inside.")
elif dc1 == 2:
    print("Bodyguard: Wow, sir! Where ya goin'?")
    print("You go inside.")
else:
    print("You go inside.")
print("Col. Birch: Here's our new recruit, and it's about time, take a seat.")
dc2 = int(raw_input("1 - Sit next to Sgt. Pedrick\n2 - Sit next to Sgt. Frisby\n3 - Sit next to SSgt. Dodge\nYour answer(by number): "))
if dc2 == 1:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
elif dc2 == 2:
    print("Sgt. Frisby: I've heard good things about you, " + name + ". You just better live up to those expectations or else...")
elif dc2 == 3:
    print("SSgt. Dodge: The cow thinks she can call me weak, don't see 'er shooting her way around. Oh, sorry, I was talking to myself, " + name + " is it? Sit down and pay attention.")
else:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
time.sleep(5)
print("Col. Birch: As most of you probably know, we are in grave danger of war with my home country of Sumantrina. They built themselves into an electrical state in 19 hours and have many nukes at stake.")
time.sleep(5)
print("Col. Birch: If we are attacked, we cannot lose A Block or C Block or else we're finished.")
time.sleep(5)
print("*A hatton soldier charged in*Soldier: Colonel! We're under attack! And I'm talking atleast 2000 soldiers out there, we can't handle it!")
time.sleep(5)
print("Col. Birch: Put yourself together! Hippo Squad, let's go! " + name + ", you're on Sniper duty, Pedrick get your plane, the rest of you, with me!")
time.sleep(5)
print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 06:22\n" + name + "\n'Sniper 101'")
print("Sgt. Pedrick: Alright, " + name + ", be grateful I brought you, now get off and do what you are supposed to.")
time.sleep(3)
dc3 = int(raw_input("1 - Jump\n2 - Stay\nYour answer(by number): "))
if dc3 == 1:
    print("You jump into C Block.")
elif dc3 == 2:
    print("Sgt. Pedrick pushes you.")
else:
    print("You jump into C Block.")
time.sleep(5)
ammo1 = 20
mag1 = 5
killed1 = 0
health1 = 100
while ammo1 > 0:
    time.sleep(5)
    if ammo1 > 0:
        break
    print("Col. Birch: " + name +", you are clear to shoot!")
    print("Your ammo: ")
    print(ammo1)
    print("Your shots left: ")
    print(mag1)
    print("Enemies killed: ")
    print(killed1)
    print("Your health: ")
    print(health1)
    st1 = int(raw_input("1 - Shoot\n2 - Reload\nYour answer(by number): "))
    enemyshoot1 = random.randrange(0, 3)
    enemydamage1 = random.randrange(1, 10)
    if enemyshoot1 == 0:
        print("The enemy missed you!")
    else:
        print("The enemy hit you!")
        health1 = health1 - enemydamage1
    if st1 == 1:
        if mag1 == 0:
            print("You reload")
            mag1 = 5
            ammo1 = ammo1 - 5
        else:
            shothit1 = random.randrange(0, 3)
            if shothit1 == 0:
                print("Shot missed!")
                mag1 = mag1 - 1
            elif shothit1 == 1:
                print("Shot hit!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
            elif shothit1 == 2:
                print("BOOM! Headshot!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
    elif st1 == 2:
        if mag1 > 0:
            print("Mag not at 0, turn missed")
        else:
            print("Fully loaded!")
            mag1 = 5
            ammo1 = ammo1 - 5
    else:
        print("TURN MISSED!")
print(name + ": Sir! I'm all out of ammo!")
time.sleep(5)
print("Col. Birch: I understand the situation, standby while I try to get Pedrick.")
time.sleep(10)
print("Col. Birch: She says she'll be on the rooftops, but she is taking heavy fire, so hurry up. Birch out.")
time.sleep(5)
dc4 = int(raw_input("1 - Go through the door\n2 - Jump out the window and hang on to the ledges\nYour answer(by number): "))
if dc4 == 1:
    print("You go through the door")
    dc4a = int(raw_input("1 - Go left\n2 - Go right\nYour answer(by number): "))
    if dc4a == 1:
        print("You go left")
        time.sleep(5)
        rubble1 = random.randrange(1, 3)
        if rubble1 == 1:
            print("You get hit by rubble!")
            health1 = health1 - 5
            print("Health: ")
            print(health1)
        else:
            print("You avoid the rubble")
        time.sleep(5)
        dc4aa = int(raw_input("1 - Go up\n2 - Breach classroom\nYour answer(by number): "))
        if dc4aa == 1:
            print("You get to the rooftops.")
            time.sleep(5)
            print("Sgt. Pedrick: I see you, " + name + "! Run!")
            time.sleep(5)
            print("You run over to Pedrick's Helicopter and jump!")
            jumpcatch1 = random.randrange(0, 4)
            if jumpcatch1 == 0:
                print("You missed the helicopter!")
                died()
            else:
                print("Col. Birch: Good job, rookie.")
        else:
            print("You breach the classroom")
            breachclass1 = random.randrange(0, 3)
            if breachclass1 != 0:
                print("Breached classroom successfully!")
                time.sleep(5)
                print("Sgt. Pedrick: Looks like I can pick you up from here")
                time.sleep(5)
                print("Col. Birch: Good job, rookie.")
            else:
                print("You died!")
                died()
    else:
        if dc4a == 2:
            print("You go right")
            time.sleep(5)
            rubble2 = random.randrange(1, 3)
            if rubble2 == 1:
                print("You get hit by rubble!")
                health1 = health1 - 5
                print("Health: ")
                print(health1)
            else:
                print("You avoid the rubble")
            time.sleep(5)
            dc4ab = int(raw_input("1 - Climb handrails\n2 - Jump out the window\nYour answer(by number): "))
            if dc4ab == 1:
                balance1 = random.randrange(0, 2)
                if balance1 == 0:
                    print("You missed the handrails!")
                    died()
                else:
                    print("You climb the handrails to the rooftops")
                    time.sleep(5)
                    print("Sgt. Pedrick: It's about time, " + name + "! Hurry it up, run!")
                    time.sleep(5)
                    print("You run over to Pedrick's helicopter and jump!")
                    jumpcatch2 == random.randrange(0, 4)
                    if jumpcatch2 == 0:
                        print("You missed the helicopter!")
                        died()
                    else:
                        print("Col. Birch: Good job, rookie.")
else:
    print("There were no ledges, so you fell to your death.")
    died()
print("Level Completed.")
print("Score: ")
print(health1 * killed1 / 2)
time.sleep(5)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 11th 2018\nTime: 12:44\n" + name + "\n'Railroads'")
time.sleep(5)
print("Col. Birch: Remeber now, Dodge?")
time.sleep(5)
print("SSgt. Dodge: Yes, sir. Now what?")
time.sleep(5)
print("Col Birch: Well, we traced Sgt. Thorpe, an absent member, to an enemy camp near the edge of Hatton. It is connected by railroads.")

A game in making also.

How long did it take you to write all of that?

2-4 hours max. Why?
Reply
#6
(12-30-2011, 04:12 PM)Mustachio Wrote:
(12-30-2011, 03:22 PM)Paradox Wrote:
(12-30-2011, 02:25 PM)Mustachio Wrote:
Code:
import sys, time, random, math

def died():
    sys.exit('You have died!\nGame over!')

print("Welcome to Kieron's Text-Based Python Game.")
time.sleep(2)
name = raw_input("???: What is your name? ")
print("???: So you are " + name + ".")
time.sleep(1)
print("???: Perfect. If you have any questions, don't refrain from asking.")
time.sleep(1)
print("1 - Who are you?\n2 - What is this game?\n3 - I have no questions")
qa1 = int(raw_input('Type one of the above: '))
if qa1 == 1:
    print("???: In this world, I am Kieron Dodge.")
elif qa1 == 2:
    print("???: This is a text-based war game, based in the Year 2018, it includes most of the people I know in it.")
elif qa1 == 3:
    print("???: Very well, then.")
else:
    print("???: I assume you want to continue.")
print("Kieron: I may have told you this already but I am Kieron or Kieron Dodge, a much less greater name, and a war has broke out on an island called Hatton in the Year 2018.")
time.sleep(6)
print("Kieron: You will be serving as a soldier in a special force of Hatton named Hippo Squad.")
time.sleep(3)
print(name + ": Hippo Squad?")
time.sleep(3)
print("Kieron: Yes, the special force faction of the Army Of Hatton. There are a few members in it, Col. 'Nat' Birch, SSgt. Kieron Dodge, Sgt. Alex Thorpe, Sgt. Wojtech Grodecki, Sgt. Adam Parret and Sgt. Mitchell Frisby.")
time.sleep(6)
print(name + ": Who are these people?")
time.sleep(3)
print("Kieron: The best youngest soldiers of the Hatton Army. But now, time is running out, it's time for you to join them. See you soon...")
time.sleep(2)
print(name + ": Wait! I still have more to ask!")
time.sleep(4)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 04:31\n" + name + "\n'War begins'")
time.sleep(2)
print("Bodyguard: " + name + ", welcome to Hippo Squad, where the youngest and strongest are put into. You've been serving for Hatton since you were 11, correct?")
time.sleep(5)
qa2 = int(raw_input("1 - Yes\n2 - No\nYour answer(by number): "))
time.sleep(1)
if qa2 == 1:
    print("Bodyguard: Just as I thought, just as talented as the others.")
elif qa2 == 2:
    print("Bodyguard: Maybe I just got the wrong impression.")
else:
    print("Bodyguard: Fine with me.")
time.sleep(5)
print("Bodyguard: We're at the conference, sir. Best of luck.")
dc1 = int(raw_input("1 - Go inside\n2 - Turn back\nYour answer(by number): "))
if dc1 == 1:
    print("You go inside.")
elif dc1 == 2:
    print("Bodyguard: Wow, sir! Where ya goin'?")
    print("You go inside.")
else:
    print("You go inside.")
print("Col. Birch: Here's our new recruit, and it's about time, take a seat.")
dc2 = int(raw_input("1 - Sit next to Sgt. Pedrick\n2 - Sit next to Sgt. Frisby\n3 - Sit next to SSgt. Dodge\nYour answer(by number): "))
if dc2 == 1:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
elif dc2 == 2:
    print("Sgt. Frisby: I've heard good things about you, " + name + ". You just better live up to those expectations or else...")
elif dc2 == 3:
    print("SSgt. Dodge: The cow thinks she can call me weak, don't see 'er shooting her way around. Oh, sorry, I was talking to myself, " + name + " is it? Sit down and pay attention.")
else:
    print("Sgt. Pedrick: Hm, looks weaker than Dodge. This'll be interesting. *she rolls her eyes* I'm Sgt. Abigail Pedrick, bla bla bla. I specialise in the air commandment of Hippo Squad bla bla bla, now pay attention.")
time.sleep(5)
print("Col. Birch: As most of you probably know, we are in grave danger of war with my home country of Sumantrina. They built themselves into an electrical state in 19 hours and have many nukes at stake.")
time.sleep(5)
print("Col. Birch: If we are attacked, we cannot lose A Block or C Block or else we're finished.")
time.sleep(5)
print("*A hatton soldier charged in*Soldier: Colonel! We're under attack! And I'm talking atleast 2000 soldiers out there, we can't handle it!")
time.sleep(5)
print("Col. Birch: Put yourself together! Hippo Squad, let's go! " + name + ", you're on Sniper duty, Pedrick get your plane, the rest of you, with me!")
time.sleep(5)
print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 1st 2018\nTime: 06:22\n" + name + "\n'Sniper 101'")
print("Sgt. Pedrick: Alright, " + name + ", be grateful I brought you, now get off and do what you are supposed to.")
time.sleep(3)
dc3 = int(raw_input("1 - Jump\n2 - Stay\nYour answer(by number): "))
if dc3 == 1:
    print("You jump into C Block.")
elif dc3 == 2:
    print("Sgt. Pedrick pushes you.")
else:
    print("You jump into C Block.")
time.sleep(5)
ammo1 = 20
mag1 = 5
killed1 = 0
health1 = 100
while ammo1 > 0:
    time.sleep(5)
    if ammo1 > 0:
        break
    print("Col. Birch: " + name +", you are clear to shoot!")
    print("Your ammo: ")
    print(ammo1)
    print("Your shots left: ")
    print(mag1)
    print("Enemies killed: ")
    print(killed1)
    print("Your health: ")
    print(health1)
    st1 = int(raw_input("1 - Shoot\n2 - Reload\nYour answer(by number): "))
    enemyshoot1 = random.randrange(0, 3)
    enemydamage1 = random.randrange(1, 10)
    if enemyshoot1 == 0:
        print("The enemy missed you!")
    else:
        print("The enemy hit you!")
        health1 = health1 - enemydamage1
    if st1 == 1:
        if mag1 == 0:
            print("You reload")
            mag1 = 5
            ammo1 = ammo1 - 5
        else:
            shothit1 = random.randrange(0, 3)
            if shothit1 == 0:
                print("Shot missed!")
                mag1 = mag1 - 1
            elif shothit1 == 1:
                print("Shot hit!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
            elif shothit1 == 2:
                print("BOOM! Headshot!")
                killed1 = killed1 + 1
                mag1 = mag1 - 1
    elif st1 == 2:
        if mag1 > 0:
            print("Mag not at 0, turn missed")
        else:
            print("Fully loaded!")
            mag1 = 5
            ammo1 = ammo1 - 5
    else:
        print("TURN MISSED!")
print(name + ": Sir! I'm all out of ammo!")
time.sleep(5)
print("Col. Birch: I understand the situation, standby while I try to get Pedrick.")
time.sleep(10)
print("Col. Birch: She says she'll be on the rooftops, but she is taking heavy fire, so hurry up. Birch out.")
time.sleep(5)
dc4 = int(raw_input("1 - Go through the door\n2 - Jump out the window and hang on to the ledges\nYour answer(by number): "))
if dc4 == 1:
    print("You go through the door")
    dc4a = int(raw_input("1 - Go left\n2 - Go right\nYour answer(by number): "))
    if dc4a == 1:
        print("You go left")
        time.sleep(5)
        rubble1 = random.randrange(1, 3)
        if rubble1 == 1:
            print("You get hit by rubble!")
            health1 = health1 - 5
            print("Health: ")
            print(health1)
        else:
            print("You avoid the rubble")
        time.sleep(5)
        dc4aa = int(raw_input("1 - Go up\n2 - Breach classroom\nYour answer(by number): "))
        if dc4aa == 1:
            print("You get to the rooftops.")
            time.sleep(5)
            print("Sgt. Pedrick: I see you, " + name + "! Run!")
            time.sleep(5)
            print("You run over to Pedrick's Helicopter and jump!")
            jumpcatch1 = random.randrange(0, 4)
            if jumpcatch1 == 0:
                print("You missed the helicopter!")
                died()
            else:
                print("Col. Birch: Good job, rookie.")
        else:
            print("You breach the classroom")
            breachclass1 = random.randrange(0, 3)
            if breachclass1 != 0:
                print("Breached classroom successfully!")
                time.sleep(5)
                print("Sgt. Pedrick: Looks like I can pick you up from here")
                time.sleep(5)
                print("Col. Birch: Good job, rookie.")
            else:
                print("You died!")
                died()
    else:
        if dc4a == 2:
            print("You go right")
            time.sleep(5)
            rubble2 = random.randrange(1, 3)
            if rubble2 == 1:
                print("You get hit by rubble!")
                health1 = health1 - 5
                print("Health: ")
                print(health1)
            else:
                print("You avoid the rubble")
            time.sleep(5)
            dc4ab = int(raw_input("1 - Climb handrails\n2 - Jump out the window\nYour answer(by number): "))
            if dc4ab == 1:
                balance1 = random.randrange(0, 2)
                if balance1 == 0:
                    print("You missed the handrails!")
                    died()
                else:
                    print("You climb the handrails to the rooftops")
                    time.sleep(5)
                    print("Sgt. Pedrick: It's about time, " + name + "! Hurry it up, run!")
                    time.sleep(5)
                    print("You run over to Pedrick's helicopter and jump!")
                    jumpcatch2 == random.randrange(0, 4)
                    if jumpcatch2 == 0:
                        print("You missed the helicopter!")
                        died()
                    else:
                        print("Col. Birch: Good job, rookie.")
else:
    print("There were no ledges, so you fell to your death.")
    died()
print("Level Completed.")
print("Score: ")
print(health1 * killed1 / 2)
time.sleep(5)
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("Date: January 11th 2018\nTime: 12:44\n" + name + "\n'Railroads'")
time.sleep(5)
print("Col. Birch: Remeber now, Dodge?")
time.sleep(5)
print("SSgt. Dodge: Yes, sir. Now what?")
time.sleep(5)
print("Col Birch: Well, we traced Sgt. Thorpe, an absent member, to an enemy camp near the edge of Hatton. It is connected by railroads.")

A game in making also.

How long did it take you to write all of that?

2-4 hours max. Why?

It just looks a lot longer than most python scripts I've ever bothered to write.
Reply
#7
Those are some good starter scripts. Though they aren't games, by the actual definition of a game. :p
Reply
#8
Personally, I would start with a game on Python. Try writing basic programs first.
[Image: chaosthegreat.png]
Reply
#9
(12-30-2011, 08:30 PM)noob007 Wrote: Those are some good starter scripts. Though they aren't games, by the actual definition of a game. :p

It meets the definition of text-based so.

CLOSE ENOUGH.
Reply
#10
(01-15-2012, 12:03 PM)Mustachio Wrote:
(12-30-2011, 08:30 PM)noob007 Wrote: Those are some good starter scripts. Though they aren't games, by the actual definition of a game. :p

It meets the definition of text-based so.

CLOSE ENOUGH.

Use PyGame
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)