Results 1 to 2 of 2
  1. #1
    Raphiel_'s Avatar
    Join Date
    Jul 2019
    Gender
    male
    Location
    Aether
    Posts
    110
    Reputation
    10
    Thanks
    84
    My Mood
    Angelic

    Question Would love some help ...

    Well where do i start, a couple of months ago i was making a little school project that i'd love to continue but i got a lilbit confused with my own code

    this is supposed to be a leveling system that now im not being able to understand mainly cuz my variable names:



    void Leveling(){

    int PLvL;
    int xpm;
    int xp_mp;
    double LvL_D;

    xp_mp = P.xpmp;
    PLvL = P.Level;
    xpm = P.xp;

    if(xp_mp == 0){
    cout<<"FIRST TIME ADQUIRING XP!"<<endl;
    xp_mp = PLvL * 1000;
    getch();
    }
    LvL_D = xpm / xp_mp;
    if(LvL_D >= 1){
    PLvL++;
    xpm = xpm - xp_mp;

    P.Level = PLvL;
    P.xp = xpm;
    xp_mp += 1000;
    P.xpmp = xp_mp;
    P.health_max += 40;
    cout<<"[|*|]>LEVEL UP!<[|*|]"<<endl;
    cout<<"[|*|]>MAX HEALTH + 40P!<[|*|]"<<endl;
    cout<<"[>>NEW LEVEL: "<<P.Level<<"<<]"<<endl;
    save();
    getch();

    }

    }

    All i know is that PLvL stands for Player level, either xpm or xp_mp is XP multiplier and the other is the actual xp andi have no clue what LvL_D is.
    There's also a class named player that contains the actual xp and level thats why there is P.Level p.xp and p.xpmp.

    This is actually confusing, i should make it from scratch...

    ー>>If it isn't blatant then keep it up.<<ー


    HOT

  2. #2
    Cloud Anarchy's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Athens
    Posts
    898
    Reputation
    28
    Thanks
    78
    My Mood
    Angelic
    When you are naming variables keep couple notes in mind:
    1. Only final variables should be in CAPS
    2. You start with capital letters only if its a class name
    3. You can either use cammelCase or underscore naming: myVar or this: my_var
    4. Your variables should have names that are self explanatory example: player_level , xp_counter
    5. Avoid using acronyms it recudes readability
    6. Have consistency for example if you do this:

    if (expression){
    // code
    }

    Keep it do not change it to this:

    if (expression)
    {
    // code
    }

    and visa versa ofc keep one coding style its easier to from someone to read it.


    For more you could read here: https://hackernoon.com/few-simple-ru...e-96cb29d4acd9
    https://en.wikipedia.org/wiki/Naming..._(programming)






     


    Quote Originally Posted by Deity View Post
    Love this guy - Best designs around!
    Quote Originally Posted by Otisホ View Post
    + rep ,That guy is a god, i just told him what i want, and he did it as i said.Same idea was in my mind, thanks !
    Quote Originally Posted by ashley_cole23199 View Post
    +1 Vouch

    Made me the sickest logo for business, definitely going to be doing future business with him, by far the best graphics designer I've used on mpgh so far!!!
    Quote Originally Posted by rop89 View Post
    Love this guy! So chill, done an amazing job on my thread and also offer free edits? What more could you ask for! THe price was basically nothing! GOing to get him to my avatar and signature soon!

    VOUCH+
    Quote Originally Posted by Heinchein View Post
    +1 for this guy, make me a logo in 2 hours ! +++ Perfect
    Quote Originally Posted by Nice View Post
    Vouch, great designs for an affordable price. Would recommend.
    Quote Originally Posted by Endl3ss View Post
    voch he made me some amazing thread work!

  3. The Following User Says Thank You to Cloud Anarchy For This Useful Post:

    Raphiel_ (04-06-2020)

Similar Threads

  1. Would love some help finding something
    By FullMetalHoodie in forum Member Introduction & Return
    Replies: 2
    Last Post: 09-20-2016, 12:35 PM
  2. New to hacking. Would love some help through skype.
    By alekskool3 in forum Member Introduction & Return
    Replies: 3
    Last Post: 12-17-2014, 02:35 PM
  3. [Help Request] I would need some help with a project *over tv*
    By Gbstar in forum C# Programming
    Replies: 2
    Last Post: 05-06-2013, 07:49 AM
  4. Really would Appreciate Some help,
    By Matthew.. in forum Help & Requests
    Replies: 3
    Last Post: 08-17-2011, 07:52 PM
  5. I would like some help C:
    By F00L in forum Combat Arms EU Discussions
    Replies: 2
    Last Post: 08-24-2010, 07:43 PM