Share your repls and programming experiences

← Back to all posts
[ GAME ] C RPG GAME
h
Coder100 (17091)

C RPG Game

After many segmentation faults, stack smashes, floating-point errors, and some more errors, I am proud to announce...
C RPG Game

About

Fight monsters, level up, buy stats to become the most powerful, and defeat the enemy that has been pillaging innocent cities for years!

Jam

This is also an entry to this jam... POG

How to play

Included inside the game, but you just have to type in the number corresponding to it.

Extra features

You can also save your game, just be aware that we won't save your pet species and name :(

The save code is in binary so it shouldn't be too hard to crack locally but on repl.it, it would be quite hard. Because of the nature of how repl.it works, make sure to fork this repl to play.

Strategy

Because there are 7 levels, and they get increasingly hard, don't level up too early! Try to go over a little bit. Also, I think having more health than attack is more important... idk send strats

Credits

  • Special thanks to @objectme12 for suggestions and helping me with saving the game!

Closing

Have a great day! Remember to fork this repl if you want to save your game and beat the final boss! (I don't think you can do this in one sitting...)

Send speedruns

Comments
hotnewtop
Whippingdot (573)

Add a kill option when clicking on pet Only 7 upvotes? You lost a lot of fan followers. @DynamicSquid is blowing up right now

ThisUserTaken (237)

You should make a post soon called T h e R o a d T o 10000 u p v o t e s once you reach 10000 upvotes (which according to my calculations is in around 1 week! Congrats in advanced! .-.)

TANMAYBAGADIA (48)

Nice one!!!! and wanna do a collab on html,css and [email protected]

Coder100 (17091)

Thanks! Also sure, what's your collab idea? @TANMAYBAGADIA

TANMAYBAGADIA (48)

@Coder100 lets create a game with spaceship

19wintersp (1120)

Nice game! Is there an issue with saving strings or something so that you can't save name?

Coder100 (17091)

@19wintersp Yeah, I don't know the length of the string, and strings aren't a single character long, so I don't know how long I would want to read the file (if at all)

19wintersp (1120)

@Coder100 I suggest using null-terminated strings: read until you get to a byte with value 0x00. (or some other arbitrary value)

Coder100 (17091)

well the thing is, I use the property that all chars are ints, and it isn't uncommon that people have a score of 0. @19wintersp

fuzzyastrocat (1513)

@Coder100 Save 0 as the char '0', not the null char '\0'

Coder100 (17091)

@fuzzyastrocat seems like a lot of work...
ok I'll try

19wintersp (1120)

@Coder100 You shouldn't need to distinguish: if you know there is only one string, and that it is at the start of the file, as soon as you get to a NULL you can just stop expecting them.

19wintersp (1120)

@Coder100 @fuzzyastrocat I've implemented it now; it's not an efficient implementation, but it (sort of) works. REPL: Coder100: C RPG savegames

fuzzyastrocat (1513)

@Coder100 If you're storing a score of 0 as '\0' (the char with integer value 0), then a score of 1 would be the ascii character SOH (start of heading) and a score of 2 would be ascii character STX (start of text). If that isn't what you're doing, then congrats you're doing it correctly. If it is what you're doing, then you have a bigger issue at hand — no player could get a score greater than 255.

To store a digit as a char, just do my_digit + '0' — that's adding an offset of my_digit to the char '0', and since chars '0'-'9' are contiguous that will create a number char from 0 to 9. It's pretty simple. (So for each digit in the number, just do that.)

19wintersp (1120)

@fuzzyastrocat I agree, the format is a bit messed up. I'm working on a binary formatter library (in C++ tho) which could be used in the game.

fuzzyastrocat (1513)

@19wintersp I wasn't responding to your saving mechanism, I was responding to coder100 saying that "saving a score of 0 as the string 0 is a lot of work".

SquidSan (1)

Think a good idea would be to make a bulk buying system, because manually inputting '2' 100 times takes too long, and even longer to finish the 'Your pet gain +1 attack!'.
I can see how this would be heard though, so sorry if this isn't possible

HTMLJSCSS (0)

This game seems broken. At first, the monsters were easy to beat, but after a while, they were impossible to beat.

Coder100 (17091)

@HTMLJSCSS the balancing is a bit like that, ig

SharkCoding (11)

This is awesome, but I would love if there were some graphics!!!

TonyYin1 (1)

@Coder100 This is an absolutely amazing game, thank you for this contribution to repl.it :)

Soccer135246 (7)

uhh what?

why can't i level up?!

Coder100 (17091)

oh that's in number 3 level @Soccer135246

Soccer135246 (7)

@Coder100 but it says level 1 iguana...

Soccer135246 (7)

@Soccer135246 and i have more than full xp

Coder100 (17091)

wait you don't appear to have leveled up @Soccer135246

Coder100 (17091)

@Soccer135246

you appear to be in shop, but we are in pet to level up

Soccer135246 (7)

i found a glitch, even when you kill an enemy it can still attack you one more time

Asherbraeden (4)

that cool man! like it a lot!

peternielsen112 (39)

Very very very pog

Good job man

peternielsen112 (39)

@Coder100 no need to thank me keep doing this stuff

[deleted]

Noice

qcm (5)

Very cool, thanks for sharing.