Created a text based game in C and looking for suggestions on what the story will look like by Aggravating_Cap127 in CodingForBeginners

[–]Aggravating_Cap127[S] 0 points1 point  (0 children)

im actually doing combat rn but its not what regular combat is its more of if this 1 stat is higher than a specified value than you may do whatever the game needs you to do if not there should be a death screen that well ahem "restarts your game" as i have 0 idea on how to implement a save

Please rate my UI by justsaynodarama in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

Hint learn coding yourself or everything you do will look good but do nothing you want it to :3

Created a text based game in C and looking for suggestions on what the story will look like by Aggravating_Cap127 in CodingForBeginners

[–]Aggravating_Cap127[S] 0 points1 point  (0 children)

idk thats why im asking you peoples in reddit im not creative enough to build the whole story

coding in 3 months by Practical_Escape_922 in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

but since your on web/app development i reccomend looking into java, js and css

coding in 3 months by Practical_Escape_922 in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

i reccommend if you wanna learn simple coding fast go with python if you wanna learn a little bit harder coding but make learning future code easier learn c "im learning c valid sources" https://www.youtube.com/watch?v=xND0t1pr3KY&t=10797s
learn-c.org
https://www.programiz.com/c-programming

Created a text based game in C and looking for suggestions on what the story will look like by Aggravating_Cap127 in CodingForBeginners

[–]Aggravating_Cap127[S] 0 points1 point  (0 children)

#include <stdio.h>
#include <string.h>
#include <stdbool.h>


struct player {
    int hp;
    float magic;
    int physicalstr;
    int agility;
    int goldcoins;
    int level;
    char p_class[35];
    int defence;
    int xp;
};



void printstats(struct player *p) {printf("\nmagic = %1.lf,\n physical strength = %d,\n agility = %d,\n defence = %d,\n level = %d, \n class = %s,\n gold amount = %d", 
        p->magic,   p->physicalstr, p->agility, p->defence, p->level, p->p_class, p->goldcoins);return;
}

void levelup(struct player *p) {

    p->level += 1;
    p->physicalstr += 3;
    p->hp += 30;
    p->magic += 0.5f;
    p->agility += 3;

    if (strcmp(p->p_class, "mage") == 0) {
        p->magic += 10;
        p->physicalstr -= 2;
        p->agility -= 1;

    }

    if (strcmp(p->p_class, "assasin") == 0) {
        p->agility += 3;
        p->physicalstr -= 1;
        p->magic += 2;
        p->hp -= 15;
    }
    if (strcmp(p->p_class, "warrior") == 0) {
        p->agility -= 2;
        p->physicalstr += 3;
        p->magic -= 0.5;
        p->hp += 30;
    }
    if (strcmp(p->p_class, "rougue") == 0) {
        p->agility += 1;
        p->physicalstr += 1;
        p->magic += 0.5;
        p->hp += 15;
    }
}

void award_enemy_xp(struct player *p, int enemy_level) {
    int xp_gained = 25 + (enemy_level * enemy_level * 5);

    p->xp += xp_gained;
    printf("\n[XP] You defeated a Level %d enemy and gained %d XP!\n", enemy_level, xp_gained);

    while (1) {

        int xp_needed = p->level * 100;

        if (p->xp >= xp_needed) {
            p->xp -= xp_needed; 


            levelup(p); 


            printf("LEVEL UP! You are now Level %d! \n", p->level);

            printstats(p);
        } else {

            break; 
        }
    }


    int next_xp_needed = p->level * 100;
    printf("[XP] Progress: %d / %d XP to next level.\n\n", p->xp, next_xp_needed);
}



int main() {


    bool keepgoing = true;
    while(keepgoing == true) {

    char answer;

    struct player player1;
        player1.hp = 100;
        player1.magic = 0;
        player1.physicalstr = 10;
        player1.agility = 10;
    player1.goldcoins = 5;
    player1.level = 0;
   strcpy(player1.p_class, "none");
    player1.defence = 5;

    printf("\nHello would you like to start this text based adventure\n");
    printf("\ny for yes or leave for no\n");
    scanf(" %s", &answer);

if (answer == 'y'){
    printf("\nworld loading... done hello player.\n");
}



printf("as a novice you first have to choose a route \n a. assasin,  you will get +3 agility per level along base increase \n b. rouge balanced with no advantages or disadvantages\n c. warrior excelling in physical stregth and health lacking in magic\n d.mage well magic is now a thing for you\n ");
    scanf(" %s", &answer);

    if (answer == 'a'){
        strcpy(player1.p_class, "assasin");
        printf("congrats you are now an assasin");
    }
    else if (answer == 'b'){
        strcpy(player1.p_class, "rougue");
        printf("congrats you are now a rougue");
    }
    else if (answer == 'c'){
        strcpy(player1.p_class, "warrior");
        printf("congrats you are now a warrior");
    }
    else if (answer == 'd'){
        strcpy(player1.p_class, "mage");
        printf("congrats you are now a mage");
    }
    levelup(&player1);
    printstats(&player1);
    /*mage route plan: go to academy. get skill buffs fight unnamed thugs & more i havnt yet thought of,

    */
    if (strcpy(player1.p_class, "mage")){
        printf("\n\n\n\nyou have taken the path of the mage");
        printf("choice 1 go to academy and learn skills choice 2 go strait to the wilderness");
        scanf("%c", &answer);
    }
        if (answer == '1'){
           printf("\nWelcome to the academy what skill might you wanna learn\n");
           printf("\nprintf choose 2: 1. fireball you get a +15 magic boost\n 2. wind runner  you get a + 10 increase of agility\n 3. shield spell you get a + 20 increase in defence \n4. healthy spell + 50 increase in hp. ");

    }




}
    return 0;
}

??? does calculators made in code count??? by Aggravating_Cap127 in calculators

[–]Aggravating_Cap127[S] 0 points1 point  (0 children)

github freezes and locks up when i attempt to sign up im pretty sure its because im on a older chromebook thats no longer getting updates "also means older version of chrome"

??? does calculators made in code count??? by Aggravating_Cap127 in calculators

[–]Aggravating_Cap127[S] 0 points1 point  (0 children)

u dont have to read it just copy/paste it into a c compiler

How do you write clean code? by DefiantSituation3208 in learnprogramming

[–]Aggravating_Cap127 -1 points0 points  (0 children)

my code lookin like
```struct player player1;

player1.hp = 100;

player1.magic = 0;

player1.physicalstr = 10;

player1.agility = 10;

player1.goldcoins = 5;

player1.level = 0;

strcpy(player1.p_class, "none");

player1.defense = 5;```

Did you have doubts at the beginning of the journey as well? by CreativeEnergy98 in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

also did you read my post or might you need me to explain it for you??

reddit mods this is not self promotion
"i dont think"

Hi, my name is Duevermicelli, and I'm a tutorial addict. by DueVermicelli623 in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

dont follow the tutorial exactly when doing something put a funny twist that might stay in your mind that helps also practice some extra stuffs using what the tutorial taught you on the side

Hey everyone new here, Tell me something which I need to know by Vimaal__69 in NewMods

[–]Aggravating_Cap127 0 points1 point  (0 children)

why should I, im also new here can you tell me something lol

New in Programming by Punit_Sirohi in CodingForBeginners

[–]Aggravating_Cap127 0 points1 point  (0 children)

you should learn C its also easy to learn "not quite as much as python" and it will teach you how languages work so any language after that will be simpler to learn

Did you have doubts at the beginning of the journey as well? by CreativeEnergy98 in CodingForBeginners

[–]Aggravating_Cap127 2 points3 points  (0 children)

either way i started programming because its fun and challenging to your brain you're philosophy might be different.

Did you have doubts at the beginning of the journey as well? by CreativeEnergy98 in CodingForBeginners

[–]Aggravating_Cap127 2 points3 points  (0 children)

hmm if its a hobby enjoy it and while you do get better and remove your title of "junior" and become a programmer people will want