move a "O"

Started by
1 comment, last by bluestrattos 20 years, 9 months ago
Hello i have this code in TC

#include <stdio.h>
#include <conio.h>
#define ESC 27
#define ENTER 13
#define HOME 71
#define END 79
#define L_KEY 75
#define R_KEY 77
#define U_KEY 72
#define D_KEY 80

struct pos{
	int x, y;
}coord;

void main(void){
	char c;
	coord.x=coord.y=1;
	_setcursortype(_NOCURSOR);
	do{
		c=getch();
		clrscr();
		switch(c){
			case L_KEY: coord.x--; break;
			case R_KEY: coord.x++; break;
			case U_KEY: coord.y--; break;
			case D_KEY: coord.y++; break;
		}
		gotoxy(coord.x,coord.y);
		printf("O");
	}while(c!=ESC);
} 
How can i do the that but in win32 code? Thanx
Advertisement
quote:
How can i do the that but in win32 code?

Like with windows and stuff?

Check this tutorial: http://www.winprog.org/tutorial/
Thank you angry, for that link. It''s very good
i just find out how to do it. it was so simple

This topic is closed to new replies.

Advertisement