Jump to content
  • Advertisement

Archived

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

bcome

What do you think of my Combat Engine?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
quote:
Original post by Ademan555
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 this post


Link to post
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 this post


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

Share this post


Link to post
Share on other sites
#include <cstdio>

int main()
{
int in = std::getchar();
printf("in==%d", in);
return 0;
}


More comments please!

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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!