1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <iostream>
#include <windows.h>
#define VK_UP 0x57
#define VK_DOWN 0x53
#define VK_LEFT 0x41
#define VK_RIGHT 0x44
using namespace std;
int W;
int A;
int S;
int D;
int X = 0;
int Y = 0;
char character = 'O';
int main()
{
char map[10][10] = {{0,1,2,3,4,5,6,7,8,9}, {10,11,12,13,14,15,16,17,18,19}};
W = GetAsyncKeyState(0x57);
if(W){
map[X][Y] = character;
Y--;
character = map[X][Y];
map[X][Y] = 'O';
}
}
|