I checked the FAQ again but there is nothing there that can help me. As far as I know, GetAsyncKeyState() is the only way to check if one of the numpad keys was pressed and I need to use those keys...
Type: Posts; User: Caze
I checked the FAQ again but there is nothing there that can help me. As far as I know, GetAsyncKeyState() is the only way to check if one of the numpad keys was pressed and I need to use those keys...
For some reason my first post was empty.
Anyway, I'm having a problem with getche() and GetAsyncKeyState(). I use getche() to store the pressed key in a string and use GetAsyncKeyState() to check...
Change the ifs to use !strcmpi.
if (!strcmpi("HP", pointchoi))
if (!strcmpi("MP", pointchoi))
That gets the points value to change but it doesn't fix the loop problem.
You have to chance your code a bit. For the first you can not use MAKEINTRESOURCE that way. If you are going use it, you have to first create a header file where you define the icon, like this:
...
I won the AI with the first try. :D
I think you should use a while loop instead of three do while loops.
while (l!=123 || health>0 || foe_health>0)
{
//The fight code
}
Much easier to understand :)
You have to excuse me because I don't know how to use those things :( I only know that the one with the array needs a default constructor.
Sorry for not having replied to your post Shadow12345. I understood a bit of that what you told and I have now read about vectors. I fixed a another problem with them but I don't understand how...
I'm making a adventure game that (of course) has an inventory. I have solved this problem, but I wonder if there is a better to way to solve it. I have used arrays where i have stored the different...
It works better now. :D
Thanks Magos and Monster for your help. :)
Ok, I will test that as soon as I can. I'm in school right now so I will post if it worked when I come home.:)
Here is the code:
int random(int low, int high)
{
srand(time(NULL));
return low + rand()%(high-low+1)
}
And with GetTickCount() it is almost the same, you just replace the
I and my friend are having problems with random numbers.
If we use time(NULL) to seed the random number, the random number appears to be the same many times but chances after a while.
Ex. 49, 49,...
getch() doesn't take any parameters. It only works if I leave
getch() empty, and I have tried that and it didn't work.
Caze slaps -Xp-:p
It didn't work. Any more ideas?:confused:
If I put a cin in the middle of fight code, the fight stops and that is not what I want. I want the fight to continue even when I'm writing and when I press enter, I want it to do the thing I wrote.
I dont know how to do that. That's why I need help.
The program is doing something and I want to write something to it while it's working.
Example: I'm in a fight (DOS text-game) and I'm loosing. I want to run to an other room, but I can't do it...