my code is showing some problem,
what i want it to do is that when the user hits space a ^ is shot from the position of the user and it moves +1 along y axis.
here is my code:
x2 = x; y2 = y // x = 50 and y is also = 50
char hit = getch();
while(true){
if(hit = '36'){ // 36 is the value for space
gotoxy(x,y);
printf(" ");
x1 = lastx; y1 = lasty + 1; // lastx and lasty are the positions of the player
gotoxy(x1,y1);
std::cout<<"^";
}
}
but its not working thanks again