This is a simple game that I am bringing to a close.
It is called Slash and Smash.

The goal is to defeat the last opponent, who is a champion of the arena.
In the game player can use potions for health and energy,go to sleep, heal up, eat and drink, gamble, beg for money, improve level, use magic, get perks and many other things.

In the final stage of programing I'll add more perks and magic, complete all 22 enemys and I will put buy and sell system for items.

But before that, I ask you to help me with suggestions and ways to improve the code and the game itself.

SAS.zip

To be honest, the code is very poorly written. There's no discernible structure, almost to the point of calling it spaghetti code, and you go about things in a highly manual way. I won't go into specific coding advice because I'm totally disinclined to read through over 2000 lines of that junk.

I agree that it is poorly written. But I'm just a beginner and this is my first project.
So do you have a general suggestion to make the code simpler?

So do you have a general suggestion to make the code simpler?

Forget goto exists.

--CHARACTER CREATING-- // I strongly suggest you change this title into "CHARACTER CREATION"
Step 1/3
Enter your name:
// It's so simple. I think you should change this one, too. It goes something like this:
"Your Desired Name:"
OR
"What is your name?

I am <Enter player's name>"

Step 2/3
Select a class: // Change this into "What are you?" or "What do you want to be?" or "Desired Class"
1-- FIGHTER
2-- ASSASSIN
3-- MAGE

INPUT: <choose from the list>


---ARENA---
--MAIN ROOM--
You've come to test your strength?
Which of these three beauties will choose today?
HP = 12/12 EN 7/7 AP = 1 GP - 35

1-- Starving Prisoner
2-- Mountain Barbarian
3-- Elder Orc
10-- Exit from Arena

WHYNOT: <create new decision making conversations using switch statement again>
// I suggest that you don't show the player's status.

Welcome to the Arena.
Have you come to test your strength?

1-- Yes and I shall fight!
2-- No, i'm not quite ready for this.

<if yes>
Very well then, brave competitor. I shall reveal your enemies.
// show the list of opponents
1-- Starving Prisoner
2-- Mountain Barbarian
3-- Elder Orc <much better name than "Old Orc">
10-- Exit from Arena

Choose your enemy wisely. Do not underestimate them.
Who shall you fight with?

INPUT: <choose from the list>

<if no>
Very well then. I shall be expecting you the next time we meet.
// exits arena

--FIGHTING GROUND--
Prepare yourself for a fight // change this into "Prepare yourself!" or "Prepare for battle..."
Opponent absorbs 4 damage
WHY NOT:
The Opponent receives 4 damage from You


You took 5 HP from opponent
WHY NOT:
You receive 5 damage from your Opponent

You are attacking an opponent (rolling the dice...)
WHY NOT:
You are attempting to attack the Opponent

You got 4
4 + Your attack 8 = 12 damage

He have not managed to cause you any damage <The Opponent has failed to give you damage.>

You won the battle and get a reward...
AP - 3
GP + 5
EXP + 2

WHY NOT:
Battle Won...
REWARD
-- 5 GP
-- 2 EXP
LOSE
-- 3 AP

CRTICS:
1.) Don't make the messages very simple. It is much better if the conversation in the game gives some excitement to players. Besides, it's a text based RPG.
2.) The game is not balanced. This is very important since you are creating an RPG game
The players and the enemies should have fair stats.
3.) Wrong grammar sentences. This is also important. Always check your grammar because players will be having a hard time understanding the conversations in the game.
4.) There's nothing wrong with your codes. What's wrong with "Go To"? What matters is the purpose and the content of your program. Think of the people who will use the program.
Not all of them are knowledgable with C++ so why bother? It's not like they are going to see your codes.
5.) You are good when it comes to programming C++. Keep it up! :)
6.) I think you should play more games and observe them. You will learn a lot of techniques from the creators. I strongly suggest you play all the Final Fantasy series and try to observe every details.
Since your genre is text-based RPG, maybe you should try playing Facebook games like "Mafia wars", "Yakuza Lords", "Avatar" and "Car Madness".
7.) Interview some friends or strangers online <maybe post Polls>. Ask them what they want in a game.

That's everything! :)

There's nothing wrong with your codes. What's wrong with "Go To"?

Nothing, if it's used very judiciously, but it's awfully easy for it to make source code into a mess of spaghetti that's difficult to follow. Code readability is important.

commented: Thank you :) +1

4.) There's nothing wrong with your codes. What's wrong with "Go To"? What matters is the purpose and the content of your program. Think of the people who will use the program.
Not all of them are knowledgable with C++ so why bother? It's not like they are going to see your codes.

You clearly have no experience writing software. Maintenance nightmares like this affect the end user through bugs and excessive time to delivery of updates and patches. In my experience, sloppy code is also often brittle and fails on a regular basis. That pisses off users too. :icon_rolleyes:

commented: Thank you... :) +1

I see.. I'm sorry but thank you for correcting me.. :)
@jonsca You are right! :)

4.) There's nothing wrong with your codes. What's wrong with "Go To"? What matters is the purpose and the content of your program. Think of the people who will use the program.

"Goto" and other sloppy design methods, while they may work, often lead to one when needing to fix a bug, coming to the old code and saying "Wait.. what the hell was I trying to do with this?" Plus, the less interdependent your code is, the better. If you need to take one thing out or change something, you don't want it crumbling your entire program. You want to program to built on a strong, sturdy, and well organized foundation, as opposed to sloppily thrown together. These are just a few reasons why "spaghetti code" is discouraged.

Jember now I see my mistakes. Thank you very much. I am already working on a new version of the game. I will try to reduce the goto command, and use more functions. I consulted a friend who is a master of the RPG genre and D&D rules. He will help me with RPG elements.

You must understand that English is not my native language. So I work with the help of google translator who is not perfect.

If you guys still have any tips feel free to tell them, because this is very interesting and I enjoy this more than playing games (;

I see.. It's understandable. Even me, I'm also having problems with the English language. :)

You are very welcome. I'm glad I had helped you anyhow. Like you, I'm also doing these stuffs on my own, too.
Well, have fun with that! Good luck and keep up the good work :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.