I want to make game using cursor control in C , but I dont have the idea . I have to make some modification in this program to create a game.Please help me. I have created this program that uses cursor control:
insert
Code:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
char ch1;
int x=0,y=0;
ch1=getch();
while(ch1!=27)
{
if(ch1=='l' & y>=0)
{
y=y-1;
gotoxy(x,y);
}
if(ch1==' ' & y<=25)
{
y=y+1;
gotoxy(x,y);
}
if(ch1=='.' & x<=80)
{
x=x+1;
gotoxy(x,y);
}
if(ch1==',' & x>=0)
{
x=x-1;
gotoxy(x,y);
}
ch1=getch();
}
gotoxy(0,0);
getch();
}