#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
void gotoxy(int x, int y);
// x 50, y 20이 게임 화면
int key = 0;
char arw = 0;
int brk = 0;
int main() {
while(1) {
cout << "------------------------------------------------------------" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| 5인용 머드게임 프로젝트 |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "| |" << endl;
cout << "------------------------------------------------------------" << endl;
gotoxy(19, 11);
cout << "게임 시작" << endl;
gotoxy(19, 12);
cout << "게임 종료" << endl;
gotoxy(17, 11);
cout << "▶" << endl;
while (1) {
key = _getch();
if (key == 224) {
key = _getch();
if (key == 80) {
gotoxy(17, 11);
cout << " " << endl;
gotoxy(17, 12);
cout << " " << endl;
gotoxy(17, 12);
cout << "▶" << endl;
arw = 1;
}
if (key == 72) {
gotoxy(17, 11);
cout << " " << endl;
gotoxy(17, 12);
cout << " " << endl;
gotoxy(17, 11);
cout << "▶" << endl;
arw = 0;
}
if (arw == 1) {
key = _getch();
if (key == 13) {
brk = 1;
break;
}
}
}
}
if (brk = 1) {
gotoxy(0, 21);
break;
}
}
}
void gotoxy(int x, int y) {
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
방향키 위아래를 받아서 ▶기호를 위아래로 옮겨주는 프로그램인데 위로 옮길때는 딜레이가 없는데 아래로 내릴때만 딜레이가 생기네요 ㅠ 뭐가 문제일까요
어디가서 C++로 짰다고 말하지 마라 쪽팔리니까 - return 0;
ㄴ;;; 클래스 기반으로 해야된다는건 아는데 아직 안익숙해서요;;
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 그냥 C언어네
ㅋㅋㄱㅋㅋㄱㅋ