Sword Play 5 C++ Console Game (with download)
Loading...
2,541
Loading...
Uploader Comments (IonicFox2nd)
see all
All Comments (23)
-
do you used multithreading? i mean becouse you can move and the creatures at the same time
-
@ChuckleluckMe2 He used kbhit() which checks for user input
-
@IonicFox2nd hmm i manage to do it in a different way:
input = getch()
while (!game+ove)
if (kbhit())
{ input = getch();
}
-
How'd you make the game run without input? I saw you used getch() but I don't see how you made the game continue to run without user input.
-
@IonicFox2nd thanks i will look up these functions
-
I love this game... Advanced rank ftw ^_^
Loading...
good work
what functions did you use to make the player move?
JakobRobert00 8 months ago
@JakobRobert00 I create a 2D character array and place the player and enemies on the array.
I use the functions kbhit() and getch() and capture user input and change the position of the characters on the array. You can research these functions on MSDN.
Let me know if you have any more questions
IonicFox2nd 8 months ago
@IonicFox2nd hey im working on a small program that fighting a mob but whit numbers not like urs whit animations, its a real time just like urs but i cant figure out how the function whit kbhit() and getch() should look, can u give me some hints if possible? tnx, oh and btw thats a sick game no matter how lame it looks. WELL DONE KEEP UP!
iiperento 2 months ago
@iiperento this assigns the pressed key's value to a variable of type char.
char keypress;
if(kbhit())
{ keypress = getch(); if(keypress == '[key]'){//do function}
}
IonicFox2nd 2 months ago
Can you make a tutorial on how to make this? Is this pure c++ or did you download addtional libaires like SDL ?
rainbowcrak 10 months ago
Sword play was created in Dev C++, and doesn't require any additional
downloads, just links to -lwinmm & -lgdi32.
Look up the following functions on MSDN
I use PlaySound() & mciSendString() to play audio files (not in video)
I use GetCursorPos(), GetClientRect & ClientToScreen() for GUI Interface
I use SetConsoleCursorPosition() to place the designs and characters
I use SetConsoleTextAttribute() for color schemes
I hope this helps
IonicFox2nd 10 months ago