这是上下左右
#include<ggoot.h>
#include<conio.h>
using namespace std;
int main(){
HideTheCursor();
char b;
for(;;){
b = getch();
if (b == 'd') {
x++;
system("cls");
gotoxy(x, y);
cout << "+";
}
if (b == 's') {
y++;
system("cls");
gotoxy(x, y);
cout << "+";
}
if (b == 'a') {
x--;
system("cls");
gotoxy(x, y);
cout << "+";
}
if (b == 'w') {
y--;
system("cls");
gotoxy(x, y);
cout << "+";
}
}
return 0;
}
这是发射子弹
#include<ggoot.h>
#include<conio.h>
using namespace std;
int main(){
for(int i=1;i<=你要多远;i++){
system("cls");