You don't NEED to implement the game's classes with C++ classes, but this is a typical case where object oriented programming(using classes) comes in handy.
There isn't a single-best way to something like this but if you decide to use C++ classes you could decide to make a:
- "common" class that holds all functions that every character has, like the amount of cash, and it would define the game class of this character(e.g. warrior).
Then for each game class you create a c++ class (maybe even this you could split into 1 common class that has functions like attack, drink potion and 1 class that inherits from this class and has the character-specific properties).
In short, there are many ways in which you could code this, if you're serious about learning C++ then you really should look at classes ;)
Well... the moderator has misunderstood me. I didn't ask how to implement classes, I'd say it's something too big to be discussed entirely/properly on a discussion board. I'm following a book, I haven't got to classes yet, and I was willing to start solving that exercise. All I wanted to know is if classes will be needed, not how to implement them.
I didn't misunderstand you, I just gave a short, uncomplete example of how you might implement classes.
In my very first sentence I note that it is not needed to use C++ classes to implement these game classes, instead you probably would use structures to store the character-specific information. So no one is forcing you to use classes in this case.
You're not a moderator, so you can't be the one I was talking about (that being John A).
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...