Archived

This topic is now archived and is closed to further replies.

What do you think of my Combat Engine?

This topic is 5415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

uhmmm.. I guess its okay.

Share on other sites
Do you think it is a good idea to have the attack/agility/defence/accuracy be tied to experience points? IMHO, I think it makes it more true to life, because the better you get at something the better it sticks to you.

u r what u bcome

Share on other sites
That is well done. I like the idea of your using a skill (def, att, etc) upping it''s lvl and exp. Though I would get away from the floating point stuff since you are getting integer points added to your exp (93.9991% exp on attack? instead go for 94/100 (94, what you have; 100, to next lvl)

I am planning on using something similer for weapon and magic. And I think I will do the same thing you are doing with att/def/dex etc. Great Job!

Erik of Ekedahl

I am a madman running through the halls of computer latency, freeing the dark-suckers from their pedistals of atrophy... man I need some sleep.

Share on other sites
Yo, couple of things, 1. GOOD 2. to get the selection... dont use cin.. or cin.get...

#include <conio.h>

getch() //returns a character, which can easily be interpreted... (the advantage is the user doesnt hafta hit enter)

switch(getch())
{
case 'Q':
case 'q':
//QuitStuff Here
break; //breaks out of the switch
case 'A':
case 'a':
//AttackStuff Here
break;
case 'Y':
case 'y':
//GetStatus Here
break;
case 'E':
case 'e':
//GetEnemyStatus Here
break;
default:
//They didnt hit any of the keys you wanted them to
}

the thing with switches is that they will keep on going right on down the line untill they hit a break, keep that in mind

[edited by - Ademan555 on February 8, 2004 9:42:48 PM]

Share on other sites
quote:
getch() //returns a character, which can easily be interpreted... (the advantage is the user doesnt hafta hit enter)
The disadvantage is that <conio.h> and its associated functions are not Standard, and thus are not supported by all libraries.

Use [std::]getchar (in <cstdio> - <stdio.h> if you''re programming in C) instead.

Share on other sites
getchar is to the same effect?

Share on other sites
Thanks!

quote:
Original post by chaim79
Though I would get away from the floating point stuff since you are getting integer points added to your exp (93.9991% exp on attack? instead go for 94/100 (94, what you have; 100, to next lvl)

Actually it does use integer, the floating point is just to tell you that you got 93.99991% of the required exp before upping. (maybe I''ll post some of my trade secret code to show you how i do it )

class Character {protected:    //...    long accuracy, xAccuracy;    //...    virtual long computeExperienceRequiredForIncreasing(StatisticType which) const;    //...public:    //...};

cout << "Accuracy XP Collected: " << float(xAccuracy) * 100.0f / float(computeExperienceRequiredForIncreasing(ACCURACY));

quote:
Original post by
2. to get the selection... dont use cin.. or cin.get...

Hey! Can''t a programmer be lazy when making a demo?

(I''ve uploaded a modified version, it is easier to beat the computer... NOT [really]!)

Share on other sites
what is the syntax of std::getchar? i looked through my headers and i couldn''t find it...

Share on other sites
#include <cstdio>int main(){    int in = std::getchar();    printf("in==%d", in);    return 0;}

[edited by - bcome on February 10, 2004 5:51:38 PM]

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• Forum Statistics

• Total Topics
633678
• Total Posts
3013290
×