Sign in to follow this  
  • entries
    78
  • comments
    138
  • views
    35516

Entry 6: My Text RPG

Sign in to follow this  

85 views

I've finished programming everything I had before from the ground up all over again. It didn't take too long but the design is much better. Thanks to jjd for pointing out that I should just pass Player around instead of Gold, Hp, Name, Weapon, ect... I should of thought of this in the first place. I guess it's going to take a little bit before I really start taking advantage of OOP. Since OOP is still new to me and I haven't used it until now, messing up here and there will happen.

Here is my new Menu System:

http://members.gamedev.net/mrcpaw/Source/CPP/Menu.cpp

I know I could of made the Selling Shop neater and did the checks much neater but It works all the same.

Now I'm off to bed and hopefully when I start working in the morning I can finish up the rest of the Battle System. I hope I finish all of this before I gotta go back to work on Monday. I'm really looking forward to getting some graphic games done soon!

Thanks for the feedback and comments! Night!
Sign in to follow this  


4 Comments


Recommended Comments

Good work! Nice to see that you are taking the time to actually put thought into the design and really learn OOP!

Also, I am not sure but on this line

cout << "\n\nWeapon: " << PlayerOne.PlayerSetWeapon();

Shouldnt you call PlayerOne.PlayerGetWeapon()? Just thought I would point that out just in case. (also since its in the player class, it doesnt really need to be called PlayerGetWeapon etc, it could just be getWeapon())...

Oh, and for your message system where you say things like weapon sold, not enough gold, etc...

You could just have one function where you pass a string and print it out, that way in a situation where the player does not have enough gold you can just call
PrintMessage("Not enough gold");, rather then having a whole bunch of small functions.

Just some suggestions for things that I saw, I am no way a pro or anything so yea..haha, keep up the good work though i enjoy keeping up with this journal.

Share this comment


Link to comment
Thanks for giving me feedback on my code. :)

Not sure if I'm answering this right, but here I go. The reason why I have small functions to display messages would be to prevent any typos so I don't have to look at each part where I type cout << "Message" to see what I did wrong. The other reason would be, if I need to change that message in the future from "Not Enough Gold" to "You're Low On Gold" all I have to do is change that message in the function to change the display of my message anywhere it's called. It just makes it easier for me to keep track of typos and if I want to change my message to something else at a later time.

The part where I call PlayerOne.SetWeapon() was because it stores the current weapon equipped and also keeps track of change in weapons for showing the name. I'm going to be adding in a better Weapon class (Which isn't in use yet) to replace all those "weapon name" you see in the shop for buy and sell with functions that keep track of names, info and how much to give in damage bonus, ect... This will also prevent typos and misinformation from spreading around. It's not going to be a big issue now, but when I get some graphic games done you wouldn't want to have this really powerful weapon that didn't give any +Damage all because of a typo like Posion Axe instead of Poison Axe.

Thanks again for the feedback! :) Now I'm off to finish off the Battle System, fix up the new Weapon System, add new items and pretty much finish this game off. Once I'm done this, other then studying some general programming concepts I didn't go over yet I'm going to start looking at HGE to get started then SDL.

Share this comment


Link to comment
Ahh I see! One thing though, you could have constant strings put in place..for example

string LOW_GOLD = "You are low on gold"

that way you can just pass those and if you need to change them, then its right there for you to change.

And also I see that you released it, great work!!!

Share this comment


Link to comment
Ahhh I forgot about doing that. Every time I read up on C++ it's always been said to use const for anything that never changes even if you plan on keeping it the same anyhow. I guess it's just to make it more clear and make it impossible to modify it by mistake. I better keep that in mind for next time.

Share this comment


Link to comment

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