Jump to content

Sharing my java games

GDRRiley

So this is my set of java text based adventure games I made over the last few years. 

You need a java test environment as I haven't ever turned them into stand alone executable.

 

Feel free to modify them and learn from them. Please if you do share it around give me credit

 

Launcher

Spoiler

/* This should be use to launch the other programs. 
  They can be run from their own main method but this is the planned way
  
*/

import java.util.Scanner;
  import java.io.IOException;
public class gabrielGameLauncher{
  
  public static void main(String[] args) throws IOException{
    Scanner scan= new Scanner(System.in);
    System.out.println("You can try all of my games I have coded here."+
                         "\n**********************************************"+
                         "\n          Created by GDRRiley                 "+
                         "\n**********************************************");
    //loop for chosing program
    System.out.println("\nEnter 1 to play \"Walk in the City\".\nEnter 2 to play \"Cave Adventure Game\".\nEnter 3 to play\"Space Flight\".\nEnter 0 to stop playing.");
    int gchoice=1;
      while(gchoice!=0){
    gchoice=scan.nextInt();
      //the 2 code runners
      if(gchoice==1){
      walkTheCity.main(args);
      }
      if(gchoice==2){
      AdventureGameS2.main(args);
      }
      if(gchoice==3){
      spaceFlight.main(args);
    }
    if(gchoice!=0)
    System.out.println("\n\nEnter another code to play a game.\nEnter 1 to play \"Walk in the City\".\nEnter 2 to play \"Cave Adventure Game\".\nEnter 3 to play \"Space Flight\".\nEnter 0 to stop playing.");
    }
    System.out.println("\nThanks for playing hope you had a great time.\nFeel free to post videos of this online. If you want to redistrubute this pack please ask me.");
  }
}

 

 OG, cave adventure game

Spoiler

import java.util.Scanner;
import java.util.Random;
public class AdventureGameS2 {
 //method that checks if you are dead
  public static int dead(Double h, int e, int playerLevel, String playerName){
if (h<0.0){
    System.out.println("Oh no " + playerName + " died! You were level " + playerLevel);
    return e=1;
   }
return e=0;

}
  
  public static void main(String[] args) {
  // TODO Auto-generated method stub
  System.out.println(  "\t***************************************************************\n"+
                       "\t  Welcome Travler, to the Cave of Wonders! Adventure awaits!  \n"+
                       "\t***************************************************************");
  Random randomGenerator = new Random();
   // Initialize player name and level and testing if dead
  
   String playerName;
   int e=0;
    String [] name={"gaben","lord gaben", "gabe", "gabriel","Keithley","noah","42","maxine"};
    String [] nameb={"greg","griggs","xavier","cody","k dog","farley","galaxykingxax","xax"};
   //created weapons and askes for name
    String[] weapons={"fist"," arm"," leg"," fist"};
   Scanner playerInput = new Scanner (System.in);
   System.out.println("What is your name?");
   playerName= playerInput.nextLine();
   //sh
   character player= new character(playerName,10,1);
   int c=0;
     while(c<name.length){
   if(playerName.equalsIgnoreCase(name[c])){
   player.changeHealth(8);
   System.out.println("You found a secret, shhhh");
   }
   if(playerName.equalsIgnoreCase(nameb[c])){
  player.changeHealth(-4);
   }
   c++;
   }
      
   System.out.println("Your are " + player.getName() + ", the level " + player.getLevel() + " foolish adventurer.\nYou feel ready to go into the cave of your dreams, you have wanted to to go into it all your childhood.\nYou have your trusty flashlight with extra batteries in your cargo pants.\nYou climb into the cave and turn on your light and walk forward until the cave increases in size.\nLooking back, you see only a hint of sunlight streaking in.");
   //First level starting
   System.out.println("You made it to the entrance of main the cave. You move your flashlight around to light the dark cobweb covered cave.\nThe damp wind wispers around you face");
   player.addLevel();
   System.out.println("You leveled up you are now level " + player.getLevel());
   //Rocks fall                 f
   double RockDamage=1;
   System.out.println("A treacherus rock ambushes you");
   player.changeHealth(-RockDamage);
   System.out.println("You took "+ (int)RockDamage +" Damage. You have " + (int)player.getHealth() + " Health remaining");
   //first loot area
   System.out.println("There is is a dark path to the left." + "\nThere is a pile of rubble to the right." + "\nDo you want to go to the left or to the right."); 
   String playerAnswer;
   playerAnswer = playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("right")){
    System.out.println("Good Choice!\nYou get a pair of old leather boots and and a Miners hat.");
    player.addLevel();
    player.changeHealth(5);
    System.out.println("You are now level " +player.getLevel()+ " adventurer and you are not a fool anymore!\nYou now have "+ (int)player.getHealth()+" Health because of the extra armor");
    
  }
   else if(playerAnswer.equalsIgnoreCase("left")){
    player.changeHealth(-RockDamage);
    System.out.println("Wrong Way. You hit you head on a rock. You have " + (int)player.getHealth() +" health");
   //Rocks fall
   System.out.println("A treacherus rock ambushes you");
   player.changeHealth(-RockDamage);
   System.out.println("You took "+ RockDamage +" Damage. You have " + (int)player.getHealth() + " Health remaining");
   
   //
    e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   }
   //
   
   else{
     System.out.println("That is not a valid answer.\nYou stumble around and take 3 damage");
     player.changeHealth(-3);
   }
   //loot 2 area
   System.out.println("As you start to walk forward you see a old sword and a backpack.\nDo you Pick it up?\nYes or No");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("Yes")){
     player.changeAtack(6);
     weapons[1]=" sword";
   System.out.println("You now have a sword that you can srike with for a minmum of "+ player.getAtack()+" damage.\n You can now hold 100 small pieces of treasure ");
   }
   //loot 3 area
   System.out.println("You see a shiney stone and gold pieces next to it and a old chestplate.\nDo you take the armor, gold and the odd stone?\nYes or No");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("Yes")){

     player.changeHealth(10);
     System.out.println("You backpack is 1/3 full but the pockets on you pants are full\nYou now have "+ (int)player.getHealth()+" health");
   //50 parts are used up
   }
   int w=0;
   //spear at door, old man
   System.out.println("A door is ahead of you and is pried open with a spear in the door.\nDo you grab the spear?\nAll of a suden a man walks up and taps you on the shoulder.\n Do you try to hit him? ");  
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
     player.changeHealth(-15);
     System.out.println("You try to hit him but he just backs away and then you get hit by a arrow to the head.\n Your health is now "+ (int)player.getHealth()+"\nYou can barely walk");
     w=1;
   }
   
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   
   
   if(w==0){
   
   if(e==0){
     if (playerAnswer.equalsIgnoreCase("no")){
       System.out.println("The man wonders why you are exporing in here?");
     }
     System.out.println("You can say: You are looking for treasure or just bored");
     playerAnswer= playerInput.nextLine();
     if(playerAnswer.equalsIgnoreCase("You are looking for treasure")){
       System.out.println("The man says he use to expore the cave when he was younger but he now live in the cave.");
     }
     if(playerAnswer.equalsIgnoreCase("just bored")){
       System.out.println("The man says he use to expore the cave when he was younger but he now live in the cave.");
     }
     System.out.println("The man leads you to a secret door and opens it.\nInside there is a small bed, a fridge, a couch, TV, and a table with 4 chairs.\n What do you think of my house.\n Do you like it?");
     playerAnswer= playerInput.nextLine();
     if(playerAnswer.equalsIgnoreCase("Yes")){
       System.out.println("I hope you have a fun time exporing the cave. I had a fun time exploring the cave, said the man.\nYou walk out back into the cave.");
     }
     else{
       System.out.println("Fine, said the man.\nHe throws you out of his house and you take 4 damage from hitting your head");
       player.changeHealth(-4);
       //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
       //
     }
   }
   }
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   if(e==0){
   //door with spear
   System.out.println("After you come back out of the man's house you look back twards the door and walk up to it.\nYou can grab the spear or try to jump over it.");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("grab")){
   weapons[2]= " spear";
   System.out.println("You can now use a spear");
   }
   else if(playerAnswer.equalsIgnoreCase("jump")){
   player.changeHealth(-3);
   System.out.println("You take 3 damage jumping over the spear.\nLeaving you with "+ (int)player.getHealth()+" health.");
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   }
   //pathway
   else{
     double falling= randomGenerator.nextDouble()*10;
     player.changeHealth(-falling);
   System.out.println("That is not a valid answer and you took "+falling+" damage");
   }
  }
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
    if(e==0){
   System.out.println("When you get through the door you see a left corrider and a right corrider.");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("left")){
     //loot
   System.out.println("You see a pile of goold and a pair of chaps.\nDo you pick them up. yes no");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
   player.changeHealth(5);
   System.out.println("Your backpack is full and you have "+(int)player.getHealth()+" health.");
   //backpack full.
   }
   if(playerAnswer.equalsIgnoreCase("no")){
   }
   }
    }
    
   //health potion
   if(playerAnswer.equalsIgnoreCase("right")){
   System.out.println("You find a health potion do you drink it?");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("Yes")){
   double falling= randomGenerator.nextDouble()*5+10;
   player.changeHealth(+falling);
   System.out.println("Your health is now "+ (int)player.getHealth());
   }
   if(playerAnswer.equalsIgnoreCase("No")){
   player.changeHealth(-3);
   System.out.println("You feel a odd slap and take 3 damage.\nYour helth is "+(int)player.getHealth());
   }
   
    //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
    }
   if(e==0){
   //room set with arrows
   System.out.println("You start to walk forward more and you see 2 rooms Chose the left or right room."); 
   playerAnswer= playerInput.nextLine(); 
   if(playerAnswer.equalsIgnoreCase("left")){
   System.out.println("You see a bow and some arrows.\nDo you want them.");
   playerAnswer=playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
   weapons[3]=" Bow and arrows";
   System.out.println("You can now use a bow and arrows");
   }
   }
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   }
   if(e==0){
   if(playerAnswer.equalsIgnoreCase("Right")){
   System.out.println("You find a Crossbow and some bolts.\nDo you want them?");
   playerAnswer=playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
   weapons[3]=" Crossbow and bolts";
   }
   }
   }
   // ATV time
//
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
    if(e==0){
   System.out.println("After you walk out of the room you see a ATV.\nDo you ride it");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
   double falling= randomGenerator.nextDouble()*5+10;
   player.changeHealth(-falling);
   System.out.println("You fall of of the ATV after 30 feet and take "+(int)falling+" damage.\n You have "+(int)player.getHealth()+" health remaning.");
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   
   } 
   if(playerAnswer.equalsIgnoreCase("no")){
   System.out.println("Good idea you would have fallen off as you had never riden an ATV before.");
   player.changeHealth(5);
   System.out.println("You randomly get a health boost.\nYou now have "+(int)player.getHealth()+" Health.");
   }
   if(!playerAnswer.equalsIgnoreCase("no")&&!playerAnswer.equalsIgnoreCase("Yes")){
   double falling= randomGenerator.nextDouble()*10+1;
   player.changeHealth(-falling);
   System.out.println("You changed your mind so you rode the ATV and took "+(int)falling+" damage from falling off of the ATV.");
   }
   //
   e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
    }
    
   if(e==0){
   System.out.println("After you continue forwards you find a orb floating around saying:I am not crazy!!\nYou are crazy!!!\nHe then offers you a health potion.\nDo you take it or not?");
   playerAnswer= playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("yes")){
   player.changeHealth(5);
   System.out.println("You thank the orb and walk away.");
   }
   else if(playerAnswer.equalsIgnoreCase("no")){
   player.changeHealth(-4);
   System.out.println("The orb zaps you leaving you with "+(int)player.getHealth()+" Health. You then walk away");
    //
   e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   }
   else{
   System.out.println("The orb zaps you taking it offensively leaving you with "+(int)player.getHealth()+" Health. You then walk away");
    //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   }
   }
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   if(e==0){
   System.out.println("You think that you can see a door a ways away that might lead out.\nYou walk forward and you see a door it looks locked what do you do?\n hit the door or Knock on the door");
   playerAnswer=playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("hit")){
   player.changeHealth(-2);
   System.out.println("You try to hit the door but it does not move and you take 2 damage from twisting your ankel.That means that you have "+(int)player.getHealth()+" health left.");
   }
   if(playerAnswer.equalsIgnoreCase("knock")){
   player.addLevel();
   System.out.println("The door opens and you level up to level "+ player.getLevel());
   }
   player.changeHealth(6);
   }
    //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   //oger time
   if(e==0){
     player.changeHealth(-6);
   System.out.println("After you go through the door you enter a large room and a ork stands in front of you and hits you with is sword doing 6 damage.\nLeaving you with "+(int)player.getHealth()+" health left\nYou can use any of you weapons "+weapons[0]+weapons[1]+weapons[2]+weapons[3]+"\nSelect with 0,1,2 or 3");          
   playerAnswer=playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("1")){
     player.addLevel();
     System.out.println("You killed the ork and gained a level.\nYou are now level " +player.getLevel());
     System.out.println("Do you want the ork's sword?");
     playerAnswer=playerInput.nextLine();
       if(playerAnswer.equalsIgnoreCase("yes")){
     weapons[1]=" Great Sword";
     }
   }
   if(playerAnswer.equalsIgnoreCase("2")){
     player.addLevel();
     System.out.println("You killed the ork and gained a level.\nYou are now level " +player.getLevel());
     System.out.println("Do you want the ork's sword?");
     playerAnswer=playerInput.nextLine();
       if(playerAnswer.equalsIgnoreCase("yes")){
     weapons[1]=" Great Sword";
     }
   }
   if(playerAnswer.equalsIgnoreCase("3")){
player.addLevel();
     System.out.println("You killed the ork and gained a level.\nYou are now level " +player.getLevel());
     System.out.println("Do you want the ork's sword?");
     playerAnswer=playerInput.nextLine();
       if(playerAnswer.equalsIgnoreCase("yes")){
     weapons[1]=" Great Sword";
     }
   }
      if(playerAnswer.equalsIgnoreCase("0")){
      System.out.println("As you rush to punch the ork with your fist it hits you in the head with its sword killing you.\nYou were player level"+player.getLevel());
     
      e=1;
      }
      System.out.println("");
      //boss 2
      if(e==0){
      System.out.println("After you defeat the ork you hear the wiz of gear and a door opens. \nWell now that you killed my pet its time to duel \nIt is the old man from the hiden house."+
      "\nWhat weapon do you want to use? You have; "+weapons[0]+weapons[1]+weapons[2]+weapons[3]+"\nselect with 0-3.");
      
      playerAnswer=playerInput.nextLine();
   if(playerAnswer.equalsIgnoreCase("1")){
     //checking you you took the ork sword, if you didn't GG
     if(weapons[1]==" Great Sword"){
     player.addLevel();
     player.addLevel();
     System.out.println("As you slash through him you hear a sizle and the old man is cut in two.\nYou leveled up. You are now level " +player.getLevel()+ ".\nCongratualtions you have defeated your hardest challenge yet");
     }
     else{
     System.out.println("You try to hit but the sword doesn't effect him.\nHe stands there and laughs. Feel the pain of Mother Russia!!\nHe pulls out a sword and dismembers you as he continues to laugh.");
     e=1;
     }
   }
   else{
      System.out.println("As you try to hit him he starts wispering, then a hole opens up and you fall down.\nYou feel as if you have been falling for ever.\nYou were player level"+player.getLevel());
      player.changeHealth(-100);
      e=1;
      }
      System.out.println("");
      }
      
   }
   
    //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   if(e==0){
   //new boss made with a while loop.
   int bossHealth=(int)Math.random()*30+40;
   boolean health=true;
    System.out.println("You hear an anoncer anounce \"This is your final test!\"");
    int blimbs=12;
    boolean sp=true;
    
   while(health==true){
     System.out.println("You have "+(int)player.getHealth()+" healh. What weapon do you swing? You have "+weapons[0]+weapons[1]+weapons[2]+weapons[3]+"\nHint use 0-3");
   playerAnswer=playerInput.nextLine();
   //main battle loop
   
   if(playerAnswer.equals("0")||playerAnswer.equals("1")||playerAnswer.equals("2")||playerAnswer.equals("3")){
     //why would you use your fist
   if(playerAnswer.equals("0")){
     System.out.println("You try to hit with your"+weapons[0]+" and you do 3 damage but take 10 from the creatures sharp scales");
     player.changeHealth(-10);
     bossHealth=bossHealth-3;
   }
   //there you go use that great sword
   if(playerAnswer.equals("1")){
     System.out.println("You try to hit with your"+weapons[1]+" and you do 15 damage but take 3 from the creatures slashing two of its "+blimbs+" limbs");
     player.changeHealth(-3);
     bossHealth=bossHealth-15;
     blimbs=blimbs-2;
   }
   //bow/crossbow works well
   if(playerAnswer.equals("3")){
     System.out.println("You try to hit with your"+weapons[3]+" but the projectile gets stuck in the scales.\nYou do minimal damage. it strikes back with "+ blimbs/3 +" of its remaing limbs and does "+blimbs/3*6+" damage.");
     player.changeHealth(-blimbs/3*6);
     bossHealth=bossHealth-2;
   }
   //a spear may do well
   if(playerAnswer.equals("2")&&sp==true){
     System.out.println("You try to hit with your"+weapons[2]+" and you do 10 damage but it gets stuck in the creatures scales rendering it broken take 10 from the creatures sharp scales");
     player.changeHealth(-10);
     bossHealth=bossHealth-3;
     sp=false;
   }
   }
   if(!playerAnswer.equals("0")&&!playerAnswer.equals("1")&&!playerAnswer.equals("2")&&!playerAnswer.equals("3")){
     System.out.println("not valid you take 2 damgae try again.");
     player.changeHealth(-2);
   }
   if(blimbs<8&&bossHealth>=0){
   bossHealth=bossHealth-5;
   System.out.println("It is starting to bleed out");
   }
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //end condition
   if(e==1||bossHealth<0||blimbs<3){
   health=false;
   }
   }
    
   player.addLevel();
   player.addLevel();
   player.addLevel();
   System.out.println("You have killed the final boss Congraduations you are now level "+player.getLevel()+" You still have "+(int)player.getHealth()+" health left.");
   }
   //ending with death check
   //
e=dead(player.getHealth(), e, player.getLevel(),player.getName());
   //
   if(e==0){
   System.out.println("You walk out of the cave and into sunlight, your eyes sting a litte when it first hits you.\nThe day looks normal until you see a giant plane fly over with a figter starting to atack it\nWar is going on and you had no idea."
    +" It has been going on for 12 hours.\nThanks "+ playerName +" for playing the game. It is still a work in progress with more planned to be added.\nFeel free to post videos of this online. If you want to redistubute it ask me.");
   }
   //if you died/ game ended
   if(e==1){
   }

        
    
  }
}

 

beginnings of space launch 

Spoiler

import java.util.Scanner;
import java.util.Random;
public class spaceFlight{
  public static void main(String[] agrs){
  Scanner scan=new Scanner(System.in);
  System.out.println( "\t******************************************************************\n"+
                       "\t  Welcome Travler, to Edwards AFB. We will be launching momentarly.  \n"+
                       "\t*****************************************************************");
  System.out.println("Please enter what you would like to be called.");
  String n=scan.nextLine();
  System.out.println("Welcome "+n+" to the Edwards AFB. This is not where rockets are normaly launched from. The main locations are The Cape in Flordia and Vandenberg AFB in Californa.\nWe here at Low Cost Space Planes need the large runways in the desert for landing and launching the launch aircraft");
  character player=new character(n,10,0);
  System.out.println("I do you want me tell you a bit more about your flight before we begin?");
  String sc=scan.nextLine();
  //choice of more information
  if(sc.toLowerCase().contains("y")){
  System.out.println("You will be in the Bolt above the Thunder launch aircraft.\nThe Thunder is powered by 6 Trent 900s. This allows the 300T Bolt to be carried and launched easily.\nThe Bolt you will be flying on is the 2nd working verison of block 2 named Essex. This is its 4th of 350 flight expected lifetime before major referbishment.");
  System.out.println("The Thunder should carry you to 65,000ft before the Bolt is launched and its quad AJ10s will fire.\nEarlier versions of this legendary motor brought men to the moon and helped the shuttle change altitude in space.");
  System.out.println("The Thunder will then decend to land back Edwards AFB, where it will be refulled and have another Bolt will be added."+
                     "\nWe bevlive the Bolt will be the future of passanger and small cargo launchers, being cheaper that any other method.");
  player.addLevel();
                       }
  System.out.println("Please choses the color of your space suit.");
  String color=scan.nextLine();
  //checks if color is a near match
  if(color.toLowerCase().contains("blue")||color.toLowerCase().contains("green")){
  System.out.println("Wow "+color+" is close to my favorite color.");
  }
  System.out.println("Ok we have a "+color+" space suit, please step this way. While we fuel the flight please get in it and have one of the techs check it.\nYou will be one of 3 tourist onboard in adition to the 2 crew and 3 astronaughts who are heading to the ISS."+
                    "The total time in space should be an hour under 5 days. Landing will happen here after your enjoy the flames of rentery.");
    player.addLevel();
    // Yes the astronaughts are current US. And Yeah I used famous people for the tourist
  System.out.println("Ok now that your ready to go I will introduce you to the rest of the crew. The other tourists are Elon Musk, and Linus Sebastion."+"\nYour Pilot will be Noah Clark, the co-pilot is Elane Douglas. From NASA we have Joseph Acaba, Serena Auñón-Chancellor, and Karen Nyberg."
                       +"The bolt is fueled everyone head out to the bus and will get to the Bolt.\nHey Musk you didn't want to pay the price for your own Space X to take you?");
  System.out.println("Musk: No I was told that I couldn't fly on it, I tried to pull rank but they wouldn't have it.");
  System.out.println("This is why Musk you can't have nice things.\nMusk: Hey "+player.getName()+" do you belive in me? and what I do.");
  String musk=scan.nextLine();
  //are you going to make Musk mad at you
  boolean muskM=false;
  if(musk.toLowerCase().contains("n")){
  System.out.println("Wow your great to be around, so happy to have you with me for the next week.\nLets be nice, your going to at least tolrate each other.");
  muskM=true;
  }
  else{
  System.out.println("Thanks for backing me up. Least your nicer than Noah.\nNoah: Why do you hate me all I said is that I would never work for Space X.");
  player.addLevel();
  }
  System.out.println("Now that you all have meet and shared feelings of each other lets go.\nThe Bolt was sitting on the Thunder a stair leads up to the door. You can see the 4 large bolts that hold them togther."+
                     "Get ready for the ride of you life. Time to orbit from now should be 1.5 hours. Push back is in 15 mins. Get up in there.");
  // describing the bolt
  System.out.println("As you walk in the Bolt you see the 8 seats in a 2-3-3 configuratin.The frount having the Pilots then NASA and finaly you between Elon and Linus\nNoah: The seats are tilled back 45 degrees to reduce the G-force."+
                     "\nAs you sit down in the chair you notice there is more than the typical seat belt. Its a 5 point harness, 2 over the shoulder, 2 from each side and 1 between your legs. A tech walks up and helps you get them buckled."+
                     "\nHe also transfers your suits imblical cord from a moblie unit to the ship. He then reminds you to please not talk on coms unless needed.\nYou being to hear the pilots go through the launch checklist.\nYou then hear a raido call: "+
                     "\"Are you ready to go Essex? Yes ready for launch. We will be departing mometarily from 18C, request airspace Clear.\"\nATC: Airspace is clear, you are cleared for takeoff."+
                     "Noah: reminder please store all lose objects, please put your tray tables up and please enjoy the flight.");
  //takeoff time
  System.out.println("As the Thunder nicknamed \'Mother Duck\' begins to spin up its engines, you begin to feel the rumble in your chest.");
  System.out.println("Over the Raido: We have an issuse with engine number 3 and 4 abort takeoff. Full reverse thrusters and airbrakes out.\nWe have had to scrap this flight, we will try agian in a few days. I know you all are disapointed.");
  
  
  
  
  
  
  
  
  System.out.println("\nThanks for playing the game. It is still a work in progress with more planned to be added.");
  }
  
}

 

beginnings of a destroyed city

Spoiler

  import java.util.Scanner;
  import java.util.Random;
  public class walkTheCity{
  
    public static void main(String[] args){
    Scanner scan= new Scanner(System.in);  
   System.out.println(  "\t*************************************************************\n"+
                       "\t\t Welcome Travler, to The Destoryed City!   \n"+
                       "\t*************************************************************");
    
    System.out.println("Enjoy walking around what remains of this once Great City.");
    System.out.println("I will be you guide. What is your name?");
    String name=scan.nextLine();
    character player=new character(name,20,1);
      System.out.println("Let me tell you a bit about myself "+player.getName()+". I was born here and lived here for almost my entire life.\nI just moved away a few months ago to go to collge. "+
    "Now tell me a bit about yourslf.");
    String about=scan.nextLine();
    System.out.println("That is intresting. Well lets get on with the tour. We can go left, right or walk forward");
    String input=scan.nextLine();
    if(input.toLowerCase().contains("right")){
    System.out.println("Ok we will go right.");
     
    
    
    
    }
    if(input.toLowerCase().contains("left")){
    System.out.println("Ok we will go left.");
     System.out.println("So up here on the left is ahhhhh!!!!.\nAs you and the guide begin to walk forward you both fell into a crack in the road.\nRIP "+player.getName()+"\nRIP Guide");
    // I don't like left so you die when you chose it. 
    }
    if(!input.toLowerCase().contains("right")&&!input.toLowerCase().contains("left")){
      if(input.toLowerCase().contains("forward")||input.toLowerCase().contains("straigt")){
      //go forward with anything else put. 
      System.out.println("Ok we will go forward.");
      }
      else{
    System.out.println("I'm not sure were you want to go, so I'm just going to go forward.");
      }
      System.out.println("So ahead to the left is the reamains of city hall and to the right is the court house.\nBoth were hit hard by the bomb, even with them being some of the strongest building in the city they couldn't take it."+
                         "Oh, I should give you this speical hazmat suit. We are going to need it as we go closer to the center of the blast.\nWe don't want to end up fried or get cancer in a week. That wouldn't be great for my ratings.");
      
      
      
      
      
    }
    
    
    System.out.println("\nThanks for playing the game. It is still a work in progress with more planned to be added.");
    }
  }

 

required character class

Spoiler

public class character {
private String name="";
private int health=0;
private double playerAtack = 1.0;
private int level=0;
public character(String n, int h, double pa){
 name=n; 
 health=h;
  playerAtack=pa;
 level=1;
}

public double getHealth(){
return health;
}
public void changeHealth(double i){
health+=i;
}
public void addLevel(){
level++;
}
public int getLevel(){
return level;
}
public String getName(){
return name;
}
public void changeAtack(double i){
playerAtack=i;
}
public double getAtack(){
return playerAtack;
}



}

 

Have fun.

 

Question to the mods is it ok to put the code ready to download in the share files area?

Good luck, Have fun, Build PC, and have a last gen console for use once a year. I should answer most of the time between 9 to 3 PST

NightHawk 3.0: R7 5700x @, B550A vision D, H105, 2x32gb Oloy 3600, Sapphire RX 6700XT  Nitro+, Corsair RM750X, 500 gb 850 evo, 2tb rocket and 5tb Toshiba x300, 2x 6TB WD Black W10 all in a 750D airflow.
GF PC: (nighthawk 2.0): R7 2700x, B450m vision D, 4x8gb Geli 2933, Strix GTX970, CX650M RGB, Obsidian 350D

Skunkworks: R5 3500U, 16gb, 500gb Adata XPG 6000 lite, Vega 8. HP probook G455R G6 Ubuntu 20. LTS

Condor (MC server): 6600K, z170m plus, 16gb corsair vengeance LPX, samsung 750 evo, EVGA BR 450.

Spirt  (NAS) ASUS Z9PR-D12, 2x E5 2620V2, 8x4gb, 24 3tb HDD. F80 800gb cache, trueNAS, 2x12disk raid Z3 stripped

PSU Tier List      Motherboard Tier List     SSD Tier List     How to get PC parts cheap    HP probook 445R G6 review

 

"Stupidity is like trying to find a limit of a constant. You are never truly smart in something, just less stupid."

Camera Gear: X-S10, 16-80 F4, 60D, 24-105 F4, 50mm F1.4, Helios44-m, 2 Cos-11D lavs

Link to comment
Share on other sites

Link to post
Share on other sites

Why didn't you package it into a jar? 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, wasab said:

Why didn't you package it into a jar? 

I never learned how to.

Good luck, Have fun, Build PC, and have a last gen console for use once a year. I should answer most of the time between 9 to 3 PST

NightHawk 3.0: R7 5700x @, B550A vision D, H105, 2x32gb Oloy 3600, Sapphire RX 6700XT  Nitro+, Corsair RM750X, 500 gb 850 evo, 2tb rocket and 5tb Toshiba x300, 2x 6TB WD Black W10 all in a 750D airflow.
GF PC: (nighthawk 2.0): R7 2700x, B450m vision D, 4x8gb Geli 2933, Strix GTX970, CX650M RGB, Obsidian 350D

Skunkworks: R5 3500U, 16gb, 500gb Adata XPG 6000 lite, Vega 8. HP probook G455R G6 Ubuntu 20. LTS

Condor (MC server): 6600K, z170m plus, 16gb corsair vengeance LPX, samsung 750 evo, EVGA BR 450.

Spirt  (NAS) ASUS Z9PR-D12, 2x E5 2620V2, 8x4gb, 24 3tb HDD. F80 800gb cache, trueNAS, 2x12disk raid Z3 stripped

PSU Tier List      Motherboard Tier List     SSD Tier List     How to get PC parts cheap    HP probook 445R G6 review

 

"Stupidity is like trying to find a limit of a constant. You are never truly smart in something, just less stupid."

Camera Gear: X-S10, 16-80 F4, 60D, 24-105 F4, 50mm F1.4, Helios44-m, 2 Cos-11D lavs

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, GDRRiley said:

Question to the mods is it ok to put the code ready to download in the share files area?

A Github link would be the most convenient. Just dont shorten the link and be sure to state what you are sharing.

COMMUNITY STANDARDS   |   TECH NEWS POSTING GUIDELINES   |   FORUM STAFF

LTT Folding Users Tips, Tricks and FAQ   |   F@H & BOINC Badge Request   |   F@H Contribution    My Rig   |   Project Steamroller

I am a Moderator, but I am fallible. Discuss or debate with me as you will but please do not argue with me as that will get us nowhere.

 

Spoiler

  

 

Character is like a Tree and Reputation like its Shadow. The Shadow is what we think of it; The Tree is the Real thing.  ~ Abraham Lincoln

Reputation is a Lifetime to create but seconds to destroy.

You have enemies? Good. That means you've stood up for something, sometime in your life.  ~ Winston Churchill

Docendo discimus - "to teach is to learn"

 

 CHRISTIAN MEMBER 

 

 
 
 
 
 
 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Good luck, Have fun, Build PC, and have a last gen console for use once a year. I should answer most of the time between 9 to 3 PST

NightHawk 3.0: R7 5700x @, B550A vision D, H105, 2x32gb Oloy 3600, Sapphire RX 6700XT  Nitro+, Corsair RM750X, 500 gb 850 evo, 2tb rocket and 5tb Toshiba x300, 2x 6TB WD Black W10 all in a 750D airflow.
GF PC: (nighthawk 2.0): R7 2700x, B450m vision D, 4x8gb Geli 2933, Strix GTX970, CX650M RGB, Obsidian 350D

Skunkworks: R5 3500U, 16gb, 500gb Adata XPG 6000 lite, Vega 8. HP probook G455R G6 Ubuntu 20. LTS

Condor (MC server): 6600K, z170m plus, 16gb corsair vengeance LPX, samsung 750 evo, EVGA BR 450.

Spirt  (NAS) ASUS Z9PR-D12, 2x E5 2620V2, 8x4gb, 24 3tb HDD. F80 800gb cache, trueNAS, 2x12disk raid Z3 stripped

PSU Tier List      Motherboard Tier List     SSD Tier List     How to get PC parts cheap    HP probook 445R G6 review

 

"Stupidity is like trying to find a limit of a constant. You are never truly smart in something, just less stupid."

Camera Gear: X-S10, 16-80 F4, 60D, 24-105 F4, 50mm F1.4, Helios44-m, 2 Cos-11D lavs

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×