Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bluestrattos

move a "O"

This topic is 5643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!