More Java Help!

QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
<div class="IPBDescription">Ohnoes!</div> Okay. So Java. Lalalala.


See, I'm still doing this text RPG. But I'm wanting to reference things from a class to create another class: Essentially, two classes will add together their values to create the final value. Example:

<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->class person {
int age, height;
}

class shoes {
int age, height;
}

class last {
int age, height;
age = person.age + shoes.age; // This is the part that won't work
height = person.height + shoes.height; // This too
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

If you don't understand, ask. But I hope this shows what I'm trying to do.

Comments

  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    <!--QuoteBegin-Quaunaut+Mar 4 2005, 11:09 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Quaunaut @ Mar 4 2005, 11:09 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Okay. So Java. Lalalala.


    See, I'm still doing this text RPG. But I'm wanting to reference things from a class to create another class: Essentially, two classes will add together their values to create the final value. Example:

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->class person {
    int age, height;
    }

    class shoes {
    int age, height;
    }

    class last {
    int age, height;
    age = person.age + shoes.age; // This is the part that won't work
    height = person.height + shoes.height; // This too
    }
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    If you don't understand, ask. But I hope this shows what I'm trying to do. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Are the int variables all non-static, as in the code example you gave? If so, making a call to person.age would give problems. There's a difference between an object of type person having a variable of data that applies to it, vs. having a variable of data shared statically amongst all objects of type person that you have instantiated.
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    Right, so how would I reference to whatever that value is within another class, without being object specific?
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    <!--QuoteBegin-Quaunaut+Mar 4 2005, 11:25 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Quaunaut @ Mar 4 2005, 11:25 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Right, so how would I reference to whatever that value is within another class, without being object specific? <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    If you want the value to belong to the class, but not be object-specific, you need to use the keyword "static." It's what lets you use classname.whatever instead of nameOfSomeObject.whatever. Example: the Math class has plenty of static things, like an absolute value function abs(). You can call it with Math.abs(integerValueHere); you don't need to bother doing "Math myMathObject = new Math(); to create an object of type math, and then myMathObject.abs() to use it.

    Making an int static is done by adding static in front of it, like
    public static int whatever;
    or
    private static int whatever;
  • ThansalThansal The New Scum Join Date: 2002-08-22 Member: 1215Members, Constellation
    hmm, what is thepoint of a non static variable?

    I am also a nub at Java but I always made my variables static....

    and shouldn't we be poking him to be ussing get/set also? <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    Nononono, I want the call to not be object specific, but I want different objects to have different variables.
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    <!--QuoteBegin-Thansal+Mar 4 2005, 11:47 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Thansal @ Mar 4 2005, 11:47 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> hmm, what is thepoint of a non static variable?

    I am also a nub at Java but I always made my variables static....

    and shouldn't we be poking him to be ussing get/set also? <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Making get/set methods to work with variables is the more professional way to do them, and has many advantages, but it's not required. The way Quaunaut is using is still possible, though it'll make bugfixing harder if he starts making the program complicated <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    It's often very useful to make objects with non-static variables. Let's say I make a class called Automobile. It's got an int variable called doors. I don't want that to be static. I want to be able to make one automobile object have 2 doors, and another automobile object have 4. It's not an equal quality shared amongst all Automobiles, and if I change it for one Automobile object, I don't want to simultaneously change it for all the others too.
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    edited March 2005
    <!--QuoteBegin-Quaunaut+Mar 4 2005, 11:49 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Quaunaut @ Mar 4 2005, 11:49 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Nononono, I want the call to not be object specific, but I want different objects to have different variables. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Ah, wait a minute...you're saying you want the <i>call</i> to be non-specific, but you <i>do</i> intend on having the different person objects have different values in an int variable?

    In that case, don't do what I told you earlier about making them static. Sorry.
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin-Marik Steele+Mar 4 2005, 09:55 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Marik Steele @ Mar 4 2005, 09:55 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin-Quaunaut+Mar 4 2005, 11:49 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Quaunaut @ Mar 4 2005, 11:49 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Nononono, I want the call to not be object specific, but I want different objects to have different variables. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Ah, wait a minute...you're saying you want the <i>call</i> to be non-specific, but you <i>do</i> intend on having the different person objects have different values in an int variable?

    In that case, don't do what I told you earlier about making them static. Sorry. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I know. I know what static means XD

    So....any way to do this?
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    Have you tried making the variables public? I know if you don't put public or private there, it may just make them public by default....but it's nice to specify it yourself.
  • ZelZel Join Date: 2003-01-27 Member: 12861Members
    if different objects have different values for age and height youll need some way to tell the program which person or shoes you are referencing.

    person x = new Person();
    x.age = 10;
    thats the object way, you make an instance then set a variable of it to that amount. you could pass a person to the last's instance creation.

    i assume youre doing some work in the main function. within main you can instanciate all three things, and pass the references to people and shoes for the last to make use of.


    this may be beyond you, and i can explain more when i;m not in class later...
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin-Marik Steele+Mar 4 2005, 09:58 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Marik Steele @ Mar 4 2005, 09:58 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Have you tried making the variables public? I know if you don't put public or private there, it may just make them public by default....but it's nice to specify it yourself. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Their public.

    But how would I reference to another classes' property's for any object?
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    Zel: No, I understand all of that just fine(though I use overload constructors more often than just being specific).

    But is there a way I could *not* be object specific, and bring up that object's properties? D:
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    Would it be possible to add a little detail to your example of how you're trying to do this? I have a thought, but I don't want to put it in here unless I'm reasonably confident it'll actually help you instead of confuse you further <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    /me runs off for the moment, likely to come back in an hour or less
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->class basepcnpc {
     int strength;
     int dexterity;
     int agility;
     int intelligence;
     int wisdom;
     int charisma;
     int hp;
     int mp;
     int cuhp;
     int cump;
     String name;
     String weaponname;
     
     basepcnpc() {
     }

     

    basepcnpc(int s, int d, int a, int i, int w, int c, int h, int m, String n){
     strength=s;
     dexterity=d;
     agility=a;
     intelligence=i;
     wisdom=w;
     charisma=c;
     hp=h;
     mp=m;
     name=n;
    }


    }

    class weapon {
        int strength = 3;
      int weapondamage;
      String weaponattribute;
    }

    class pcnpc {
    String combatant1 = "player";
    int str, dex, agi, Int, wis, cha, xhp, xmp, chp, cmp;
    int getStr() {
    int a = player.strength + weapon.strength;
    return a;
    }
    }<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    This is the exact context I'm using it in. Everything else is later- I'm just trying to get pcnpc to add the strength value of weapon with the one of basepcnpc.
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    edited March 2005
    Well, because it's not static, you can't call weapon.strength. You'll need to make an object of type Weapon, and call thatObjectName.strength.

    In the case of player, it's not the name of a class you've made (or at least not one you've shown us), and it's not the name of an object you've created (or at least you haven't shown us where you did create it). Kinda hard to call player.strength when player doesn't exist <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    Right, I understand that. But can I do something like...


    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    class pcnpc {
    String combatant1 = "player";
    int str, dex, agi, Int, wis, cha, xhp, xmp, chp, cmp;
    int getStr() {
    int a = combatant1.strength + weapon.strength;
    return a;
    }
    }
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    And have the player.strength and weapon.strength referring to whatever object I choose, dynamic on say, combatant1?
  • Marik_SteeleMarik_Steele To rule in hell... Join Date: 2002-11-20 Member: 9466Members
    No, because combatant1 is an object of type String. It does not have a variable strength that you can ask for.
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin-Marik Steele+Mar 4 2005, 10:58 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Marik Steele @ Mar 4 2005, 10:58 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> No, because combatant1 is an object of type String. It does not have a variable strength that you can ask for. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I understand, but it's string is "player", and I wish that would be displayed there. Could I do that at all?
  • ThansalThansal The New Scum Join Date: 2002-08-22 Member: 1215Members, Constellation
    all you have to do is make an instance of weapon and basepcnpc (WTH is with that name? <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> is it the base for both PCs and NPCs? if so name it character or something, but that ijust my preff in name schemes)
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    edited March 2005
    <!--QuoteBegin-Thansal+Mar 4 2005, 11:11 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Thansal @ Mar 4 2005, 11:11 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> all you have to do is make an instance of weapon and basepcnpc (WTH is with that name? <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> is it the base for both PCs and NPCs? if so name it character or something, but that ijust my preff in name schemes) <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Yeah, thats where the name is from. This is easy for me, I guess.

    And I have instances of them. I'm having trouble adding them together to make the properties for pcnpc.


    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->import javax.swing.JOptionPane;
    class basepcnpc {
     int strength;
     int dexterity;
     int agility;
     int intelligence;
     int wisdom;
     int charisma;
     int hp;
     int mp;
     int cuhp;
     int cump;
     String name;
     String weaponname;
     
     basepcnpc() {
     }

     

    basepcnpc(int s, int d, int a, int i, int w, int c, int h, int m, String n){
     strength=s;
     dexterity=d;
     agility=a;
     intelligence=i;
     wisdom=w;
     charisma=c;
     hp=h;
     mp=m;
     name=n;
    }


    }

    class weapon {
        int strength = 3;
      int weapondamage;
      String weaponattribute;
    }

    class pcnpc {
    String combatant1 = "player";
    int str, dex, agi, Int, wis, cha, xhp, xmp, chp, cmp;
    int getStr() {
    int a = player.strength + weapon.strength;
    return a;
    }
    }

    class rpg {
    public static void main(String args[]) {

    /*sdaiwchm*/weapon sword = new weapon();
    weapon axe = new weapon();
    weapon club = new weapon();
    basepcnpc player = new basepcnpc();
    basepcnpc imp = new basepcnpc(3,1,5,2,1,1,45,0,"imp");
    imp.weaponname = "Claw";

     // Character creation system.
     for(int choicepoints=30;choicepoints>0;choicepoints--){
      String Choices;
      int choices;
      Choices = JOptionPane.showInputDialog("Choose what to put your attribute points into?"+
      "\n 1. Strength : "+player.strength+
      "\n 2. Dexterity : "+player.dexterity+
      "\n 3. Agility : "+player.agility+
      "\n 4. Intelligence : "+player.intelligence+
      "\n 5. Wisdom : "+player.wisdom+
      "\n 6. Charisma : "+player.charisma+
      "\n Choose by number. You have "+choicepoints+" points left to put into attributes."+
      "\n Just remember to put at least a few points into everything, or you may find your character...limited.");
      choices = Integer.parseInt(Choices);
      if(choices==1)player.strength++;
      if(choices==2)player.dexterity++;
      if(choices==3)player.agility++;
      if(choices==4)player.intelligence++;
      if(choices==5)player.wisdom++;
      if(choices==6)player.charisma++;
     
      player.weaponname = JOptionPane.showInputDialog("What kind of weapon do you use?\n 1. Sword \n 2. Club \n 3. Axe");
      if(player.weaponname=="1")player.weaponname= "Sword";
      if(player.weaponname=="2")player.weaponname= "Club";
      if(player.weaponname=="3")player.weaponname = "Axe";
     
     
    }
    player.hp=(player.strength*5)+20;
    player.mp=(player.intelligence*5)+10;
     
    System.out.println(player.name+"'s Character Sheet:");
    System.out.println();
    System.out.println("Health: "+player.hp);
    System.out.println("Mana: "+player.mp);
    System.out.println();
    System.out.println("Strength: "+player.strength);
    System.out.println("Dexterity: "+player.dexterity);
    System.out.println("Agility: "+player.agility);
    System.out.println("Intelligence: "+player.intelligence);
    System.out.println("Wisdom: "+player.wisdom);
    System.out.println("Charisma: "+player.charisma);

    System.out.println("An Imp spawns behind you!");

    for(;player.hp!=0||imp.hp!=0;){
     String Battlechoice =JOptionPane.showInputDialog("The Imp Spawned Behind you. What do you do?\n 1. Attack \n 2. Lightning \n 3. Heal");
     int battlechoice;
     battlechoice = Integer.parseInt(Battlechoice);
     if(battlechoice==1);
     if(battlechoice==2);
     if(battlechoice==3);
     
     String combatant1 = "player";
    }
    System.exit(0);
    }
    }<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    This is all of it: The battle system does nothing, atm.
  • SnidelySnidely Join Date: 2003-02-04 Member: 13098Members
    edited March 2005
    This is the sort of thing it's best to get your hands dirty in. I'll fire up my text editor and take a look at it, if no-one else solves it beforehand. It might take awhile due to family problems... my sister has gone completely and utterly bonkers.

    I love Java. (Gonna move onto animation next. Eeeek.)
  • TranquilChaosTranquilChaos Join Date: 2003-07-25 Member: 18425Members
    I would pass the the pc's constructor the objects it needs to know about .

    PlayerCharacter (Weapon w, Hat h, Shield s, Etc e)
    {
    myWeapon = w;
    myHat = h;
    myShield = s;
    myEtc = e;
    }

    The PlayerCharacter class would contain methods to change these values as necessary Also, if the player always starts with certain items ( or certain items based on class, these could be constructors as well)

    PlayerCharacter(PlayerClass pc)
    {
    if(pc.class == "wizard")
    {
    myWeapon = new Weapon(//Whatever value creates a wand);
    myArmor = new Armor(//Robes);
    myEtc = // Initialize other objects with the default values;
    }
    else if(pc.class == "warrior")
    {
    myWeapon = new Weapon(// Sword);
    // Etcera, etcera, (Note: == does not work when comparing strings, use equals() method
    }
    }

    equipWeapon(Weapon w)
    {
    // Remove equipped weapon if weapon is not bare hands, add to inventory
    if(myWeapon.valuethatindicatesweapontype != valueofbarehands)
    myInventory.add(myWeapon);
    myWeapon = w;
    // If w was in inventory, it must be removed, giving each item a unique value on creation with a static int stored in the item's class would be good for finding and removing it from the inventory
    }


    I think it would be a good idea for the PlayerCharacter class to contain Equipped Items, Inventory, Environment (Having it be able to reference it's own location in the game environment could be useful.)
  • TranquilChaosTranquilChaos Join Date: 2003-07-25 Member: 18425Members
    Now that I have more time, let me make a better example. I have renamed the classes to make their purposes more immediately discernable. Descriptive names and the use of comments makes interpreting your code easier for others.

    public class BasicCharacterTemplate
    {
    int strength;
    int dexterity;
    int agility;
    int intelligence;
    int wisdom;
    int charisma;
    int hitpoints;
    int magicpoints;
    int maxiumhitpoints;
    int maxiummagicpoints;
    String myName;
    int attackStrength;

    public BasicCharacterTemplate(int str, int dex, int agi, int intel, int wis, int cha, int hp, int mp, int maxhp, int maxmp, int name)
    {
    // initialize all of the class variables
    attackStrength = calculateAttackStr();
    }
    // Basic formula for calculating attack power, can be overriden in other classes
    public int calculateAttackStr();
    {
    return myStrength();
    }

    public int myStrength()
    {
    return strength;
    }

    // Methods to change variables and return variables, generally most the above variables would be declared private and would have public methods that return them, this is to prevent the accidental modification of important variables

    }

    // PlayerCharacter is based on BasicCharacterTemplate
    public class PlayerCharacter extends BasicCharacterTemplate
    {
    Weapon myWeapon;
    Inventory myInventory;
    Shield myShield;
    Helm myHelm;
    Etcera myEtc;

    public PlayerCharacter(int str, int dex, int agi, int intel, int wis, int cha, int hp, int mp, int maxhp, int maxmp, int name, Weapon w, Inventory i, Shield s, Helm h, Etcera etc)
    {
    // Initializes the variables from the BasicCharacterTemplate with call to super class
    super(int str, int dex, int agi, int intel, int wis, int cha, int hp, int mp, int maxhp, int maxmp, int name)
    // Initializes the variables unique to PlayerCharacter
    myInventory = i;
    myShield = s;
    myHelm = h;
    myEtc = e;
    myWeapon = w;
    }
    // Example method equipping a weapon, is private because it would be called by another method telling it what weapon to equip. (Ex: Game reads Player input telling it to equip weapon x from player inventory if x is in the inventory, it is removeds and equipWeapon is called with the weapon as a parameter.

    private void equipWeapon(Weapon w)
    {
    // isHands would be whatever method you choose to check if weapon in use is bare hands ! means that if isHands returns false, then proceed with action
    enclosed in if statement, add would be an Inventory method that adds items to inventory
    if(!myWeapon.isHands())
    myInventory.add(myWeapon);
    myWeapon = w;
    }

    // Overrides basic calculateAttackStrength method in BasicCharacterTemplate, weapon damage is added in
    public int calculateAttackStrength()
    {
    // myStrength is a method that from BasicCharacterTemplate that returns value of Str, AttackPower is a method from the Weapon Class that returns attack power
    return myStrength() + myWeapon.AttackPower()
    }

    // Manages the combat situation
    public class CombatSimulator
    {
    // A method that retuns the damage dealt by an attack, a helper method to a public method, (Ex: Player hits monster, call Monster.changeHitPointValue(calculateDamage(player.calculateAttackStrength(), monster.calculateDefenseStrength)

    private int calculateDamage(int attackerPower, int defensePower)
    {
    return attackerPower - defensePower;
    }

    }

    All sorts of additional variables could be added in to add flavor, but for simplicities sake these are just basic examples. (Ex: calculateDamage(attackPower, attackElement, defensePower, defenseElement))
    Also, it would help make your code more readable if you followed proper method, variable and class name guidelines.
    Class Names: PlayerCharacter, Mouse, MouseHouse
    Variable and Method Names: playerCharacter, mouse, mouseHouse
    And remember, comments are good, and lengths of the names of methods, classes and variables don't effect the speed at which a compiled program runs.
  • Mad_ManMad_Man Join Date: 2003-06-13 Member: 17359Members, Constellation
    edited March 2005
    Just as a side note when looking at the code with your 1-6 menu, I perfer to use a switch instead of 8 billion if statments
Sign In or Register to comment.