Computer Science Canada [b]This is a text game [/b] |
Author: | warburk [ Wed Dec 06, 2006 10:13 am ] |
Post subject: | [b]This is a text game [/b] |
This the is code for this game So insted of the other ones that i've posted you don't need to download. Code: %After Game (Start) (Text Game) var die1, die2 : int %Used for the dice roll at the beginning var reply : string (1) %Also Used for the dice var reply1 : string %Used for the reply for a weapon var gone : int %Used to find the attack of the weapon var mastersword, magicblast, canon, machinegun : string %Used to pick the weapon var reply2 : string %Used for the reply for the shield var hell : int %Used to find the defence of the shield var dragonshield, forcefield, blastshield, minecanonshield : string %Used to pick the shield var reply3 : string %Used for the reply for the pet var smell : int %Used to find the power of the pet var cat, dog, other : string %Used to pick out the pets power var petName : string %Used to pick the name for the pet var spName : string %Used for the other pets in the game var power, defence, animal : int %The grand total of the attacks for the person var reply4 : string %Used to find the year you were sent to var reply5 : string %Used to find the place you were sent to %Start of the Game var reply7 : string (1) %Used at the beginning of the game/end of intro var place : string %Places on the planet that you chose %Graveyard var sure : int %Reaper's Attack var sure1 : int %Reaper's Defence var sure2 : int %Swordsman(GRyard) attack var sure3 : int %Swordsman(GRyard) defence var repain : string %Graveyard var repain1 : string %Actions in the graveyard %The mall var easyXY : string %Enter the mall var easyXYZ : string %After Knock out (Mall) var easy1 : string %Gun scene var easy2 : int %roll var easy3 : int %kick var easy4 : string var easy5 : string var store : string %Choosing what store you want to go to var store1 : string %The Pit of Doom var easy : string %The Pit of Doom (1) var easyX : string %The Pit of Doom (2) %Money var mon : string %The money that you get for free (price) var mon2 : string %Second Money Part var dice, dice2 : int %Getting money %Coin Flips var flip : int %Reaper Battle var flip1 : int %Swordsman Battle var flip2 : int var flip3 : int %Coin Flips(2) var coin : int var coin1 : int var coin2 : int var coin3 : int %Names var firstName : string %your name var firstName2 : string %S.captain of the train var firstName3 : string %Masked Woman var firstName4 : string %Woman on the road with money var firstName5 : string %Person in front of the mall %Fonts var font : int %Title Page var font1 : int %Hints var font2 : int %Mall scene var font3 : int var font4 : int var font5 : int %Sounds var note : string (1) var note1 : string (1) var note2 : string var note3 : string var note4 : string %Background colorback (47) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for font := Font.New ("Algerian:24") Font.Draw ("Kyle Warburton's Game", 200, 110, font, green) Font.Draw ("Dragon Destiny of Darkness", 160, 300, font, red) drawfillmapleleaf (100, 100, 200, 200, red) getch (note) play ("<b,c>,d,e,b<,e,<c,<c>") play ("<d,>c<,>e<,c,a,b,a,b,f") play ("<c,>c<,>d<,>a<,>b<,") delay (7000) %Background colorback (60) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Name Area font1 := Font.New ("Castellar:13") Font.Draw ("Hints for the Game...", 0, 160, font1, yellow) Font.Draw ("Make sure you put it in right!", 25, 100, font1, red) Font.Draw ("The quotations give you the ability to give out-", 25, 80, font1, purple) Font.Draw ("more than one name like (Peach/'Peach Fussy McDonald).", 25, 120, font1, blue) put "Enter name here." .. get firstName put "Hello, ", firstName, "." %Background colorback (34) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for getch (note1) play ("<b,c>,d,e,b<,e,<c,<c>,d,c>,e,f") play ("b,c,<d,e,>e,<a,b,f") % This is part is rolling a pair of dice put " First you have to roll a pair of dice." put "Do you want to roll (just put y)?" .. get reply if reply = "y" then randint (die1, 1, 6) randint (die2, 1, 6) put "You rolled ", die1 + die2, "." elsif reply = "n" then put " To get a power boast you need to roll the dice." else put "Reply y or n" end if %The total power adds up put " The total power you got from the dice adds with your other power." put "The dice power gave you a ", die1 + die2, "." put "Plus the power you get each battle you get." put " Which weapon do you want(mastersword,magicblast,canon,machinegun)?" .. get reply1 randint (gone, 1, 125) if reply1 = "mastersword" then put "The power of the mastersword is, ", gone, ", Here you go ", firstName, "." elsif reply1 = "magicblast" then put "The power of the magicblast is ", gone, ", Here you go ", firstName, "." elsif reply1 = "canon" then put "The power of the canon is ", gone, ", Here you go ", firstName, "." elsif reply1 = "machinegun" then put "The power of the machinegun is ", gone, ", Here you go ", firstName, "." end if %The armor power of the person put " This is the armour part of the warrior that you create." put "The armour doesn't gain power from the dice, but only from the battles." put " Which armour do you want(dragonshield,forcefield,blastshield,minecanonshield)?" .. get reply2 randint (hell, 1, 125) if reply2 = "dragonshield" then put " The defence of the dragon shield is ", hell, ", Here's your shield ", firstName, "." elsif reply2 = "forcefield" then put " The defence of the force field is ", hell, ", Here's your shield ", firstName, "." elsif reply2 = "blastshield" then put " The defence of the blast shield is ", hell, ", Here's your shield ", firstName, "." elsif reply2 = "minecanonshield" then put " The defence of the mine canon shield is ", hell, ", Here's your shield ", firstName, "." end if delay (2500) %Background colorback (24) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %The pets put " This part is where you get to pick your own pet." put "The pet only helps you and not your main power." put "The other pets include (Dragon, Horse, Dorf)." put "Which pet do you want (cat,dog,other) ?" .. get reply3 randint (smell, 25, 85) if reply3 = "cat" then put " The attack and defence of the animal type is ", smell, "." elsif reply3 = "dog" then put " The attack and defence of the animal type is ", smell, "." elsif reply3 = "other" then put " You have to choose the species of the other animal." put "Dragon, Horse, or Dorf." get spName put " Now you own a pet ", spName, "." put "It's attack/defence is ", smell, "." end if %The pets name put "Enter the name that you would like to call your pet in quotations." put "Enter name" .. get petName put " Here's your pet named ", petName, "." %The total score put "Your weapon is ", reply1, " and the power is ", gone + die1 + die2, "." put "Your shield is ", reply2, " and the power is ", hell, "." put "Your pet is a ", spName, " and the power is ", smell, "." put " Where do you want to go (thesun, deadlake, grandcanyon, or halloweentown) ?" .. get reply5 if reply5 = "deadlake" then put "Your going to Dead Lake, ", firstName, "." elsif reply5 = "grandcanyon" then put "Your going to the Grand Canyon, ", firstName, "." elsif reply5 = "thesun" then put "Your going to The Sun, ", firstName, "." elsif reply5 = "halloweentown" then put "Your going to The Sun, ", firstName, "." end if put "What time do you want to go to (years)", reply5, "(1400, 1200, 3000, 4000, 10,000)?" .. get reply4 if reply4 = "1400" then put "Your going to be travelling to the 1400 AD ", firstName, "." elsif reply4 = "1200" then put "Your going to be travelling to the 1200 AD ", firstName, "." elsif reply4 = "3000" then put "Your going to be travelling to the year 3000 BC ", firstName, "." elsif reply4 = "4000" then put "Your going to be travelling to the year 4000 AD ", firstName, "." elsif reply4 = "10,000" then put "Your going to be travelling to the year 10, 000 BC ", firstName, "." end if put "First we're going to play a little game while the system is loading..." delay (2000) %Background colorback (9) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Background colorback (10) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Background colorback (11) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Finished Loading put "You are finished loading and now the game." put "Do you want to end the game?" put "(y or n)" get reply7 loop exit when reply7 = "n" put "You're now out of the game." end loop %Begin the Game put "You're on your own from now on." put "Your weapons are ", reply1, "and", reply2, "." put "Your pet is a ", spName, " and named ", petName, "." delay (850) %Background colorback (27) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for put " Your name is ", firstName, ", and your pet's name is ", petName, "." put " Your total power is ", gone, " and ", hell, " that's all of your power that you have." delay (1200) for i : 0 .. maxy drawfillmapleleaf (0, 0, i * 2, maxy - i, i mod 16) sound (i * 2 + 10, 75) end for for decreasing i : maxy .. 0 drawfillstar (0, 0, i * 2, maxy - i, i mod 16) sound (i * 2 + 10, 75) end for %Background colorback (89) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Variables % On the Train put " Here you go." put " You've just arrived at ", reply5, "." put " The time you have arrived there is ", reply4, "." put " First place you are in this game when you're beginning is a hotel." put " You can wake up now. says a man with a overly happy smile." put " Where am I? says ", firstName, "." put " We're coming into the stop! shouts a woman that's running down the hall." put " Don't you remenber? said the man behide him." put " All I can't remenber anything. says", firstName, "." put " Well my name is (Type his name)" .. get firstName2 put " Well my name is, ", firstName2, " and I'm the Second Captain of this train." put " Who or what was that was running down the hall? said ", firstName, "." put " That was (put her name)" .. get firstName3 put " That was, ", firstName3, " and she was running to the exit." put "Well you have to get off the train now. says ", firstName2, "." put "OK, I'll get off the train. says ", firstName, "." delay (2000) %Background colorback (54) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for put "Where am I? says ", firstName, "." put "Oh I forgot to tell you where you are? says ", firstName2, "." put "We're on ", reply5, "." put "Oh, I'm on ", reply5, ", how do I get back to where I was." put "This Train isn't getting back there until next year." put "All aboard the Train going to Bonevile!" put "Bye, you can go into the mall for now. says ", firstName2, "." put "The Mall, right says ", firstName, "said in his mind." %ROAD MAP delay (1800) %Background colorback (54) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for %Paths put "( You're walking down the path and find so directions)" put " Where do you want to go? " put "(themall, thepitofdoom, graveyard, houses,or industries)" get place if place = "themall" then put "You're on the right track to the end ", firstName, "." elsif place = "graveyard" then put "Your now going to the graveyard ", firstName, "." elsif place = "houses" then put "You can buy a house now or sell." elsif place = "industries" then put "You now can get a job and get money ", firstName, "." loop exit when place = "thepitofdoom" put "You have a ver unstable fate coming to you ", firstName, "." end loop end if % The Mall if place = "themall" then put "Your going on the Mall track now ", firstName, "." put "This is where you buy things and sell things." put "On the path you meet a woman named ..." get firstName4 put "Hello ", firstName4, "!" put "Don't you want some money and roll the dice (y or n)? says ", firstName4, "." get mon if mon = "y" then put "So you do want some money ", firstName, "." put "Well you going to have to roll a pair of dice." elsif mon = "n" then put "You have no money to buy anything at the Mall." end if end if put "Do you want to roll ?." get mon2 if mon2 = "y" then randint (dice, 4, 10) randint (dice2, 4, 10) put "That's how much you get is ", dice * dice2, "in orbs of light." elsif mon2 = "n" then put "Ok, I'm off now ! yells the woman named ", firstName4 end if put "After you finished talking to her and a few minutes later you come to the mall." put "Hello, my name is ..." get firstName5 put "Hello, my name is ", firstName5, "." put "What's your name? says ", firstName, "." put "My name is ", firstName, "." put "Hello ", firstName, ", I'm the paste boy for the mall." put "How much are you going to spend in the mall said ", firstName5, "." put "The amount I have is ", dice * dice2, " orbs of light." put "Wellcome into the mall and spend your money. says ", firstName5, "." delay (1500) %Background colorback (49) for row : 1 .. 25 for column : 1 .. 80 locate (row, column) %Ouput put " " .. end for end for font2 := Font.New ("Jokerman:20") Font.Draw ("Welcome to the Mall", 200, 110, font2, green) Font.Draw ("Where you can get anything!", 120, 300, font2, red) drawfillstar (50, 100, 230, 300, yellow) delay (4500) put "Do you want to go into the mall?" get easyXY if easyXY = "y" then put "(Powder has been dropped on you head)" put "You've down knocked out stone cold by the powder!" end if loop exit when easyXY = "n" put "Welcome!" put "You've beaten the game!" put "You found a secret portal to you own world." put "Now you're back " end loop %Actions if easyXY = "y" then put "What are you going to do(roll,kick,grab/run,shootback,staystill)?" get easy1 if easy1 = "roll" then put "(The bullet just missed you)" elsif easy1 = "kick" then put "(You kick the gun out of her hands)" elsif easy1 = "grab/run" then put "(You turn and grab the gun out of her hands and run)" elsif easy1 = "shootback" then put "(Tou quickly grabed your gun tried to shoot her)" loop exit when easy1 = "staystill" put "The woman says to stay still and you followed her orders." put "Then she tells you to turn around." put "Then she shoots you and you're now dead." end loop end if end if %The Rollback if easy1 = "roll" then put "The bullet missed you and you try to get away." put "Roll the dice(evens you live and odds you die)" randint (easy2, 1, 2) put "You rolled a ", easy2 if easy2 = 2 then put "You got away in the right amount of time!" loop exit when easy2 = 1 put "You didn't make it and you end up dead!" end loop end if end if %The Kick if easy1 = "kick" then put "You tried to kick the gun out of her hands." put "(even you die and odd you live)" randint (easy3, 1, 2) if easy3 = 1 then put "You've kicked the gun out of her hands." loop exit when easy3 = 2 put "You missed and the gun is still in her hands." put "Then she shot you in the chest and died." end loop end if end if % Graveyard if place = "graveyard" then put "You are now in the graveyard! yells someone in the dark." put "What do you do(fight,runaway,walkin,stay)?." get repain if repain = "fight" then put "I Command you to fight me in a battle!" elsif repain = "runaway" then put "Good Bye and I'm gone!" elsif repain = "walkin" then put "I coming in here and you can't stop me!" elsif repain = "stay" then put "You end up freezing up and can't move." end if end if %Graveyard(fight) if repain = "fight" then put "I accept your challenge to duel to the death!" put "Well, well you want to battle against me!" put "I'm the great Reaper of the Dark named RIP!" put "This is the reaper's power." randint (sure, 25, 90) put "The Reaper's attack is ", sure, "." randint (sure1, 20, 75) put "The Reaper's defence is ", sure1, "." put "Your Attack/Defence is ", gone, "/", hell, "." put "First you must pick a number (1 or 2)." end if %Graveyard(runaway) if repain = "runaway" then put "I'm going now and you can't keep me here!" end if %Graveyard(walkin) if repain = "walkin" then put "I'm walking into the graveyard and you can't stop me!" end if %Graveyard(stay) if repain = "stay" then put "Your now stuck in one position ", firstName, "." put "(Then the Reaper whispers something in your ear)" put "That is that someone is behide you." put "Do you (turnaround,runahead,jump,duck)" get repain1 if repain1 = "duck" then put "A sword slashed and since you ducked your life was saved." put "The swordsman was trying to get an easy kill." put "So you want to battle?" put "Yes, said the swordsman" elsif repain1 = "runahead" then put "(You start to run into the graveyard)" put "(The sword just misses you and your life was saved)" elsif repain1 = "jump" then put "(You jumped)" loop exit when repain1 = "turnaround" put "(You start to turn around when it happened)" put "A sword slashed right at you and cut you in half!", firstName, "." put "Now you're dead!" end loop end if end if if repain1 = "duck" then put "This is the the power of the swordsman." randint (sure2, 15, 50) randint (sure3, 10, 60) put "The attack of the swordsman is ", sure2, "." put "The defence of the swordsman is ", sure3, "." put "Your attack/defence is ", gone, "/", hell, "." put "First you must pick a number (1 or 2)." get flip1 randint (coin1, 1, 2) if flip1 = coin1 then put "You're first to attack the swordsman." end if end if ![]() [/i] |