既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
putchar('\*');
printf("\n");
for (j = 1; j < plane_x - 2; j++)
putchar(32);
printf("\*\*\*\*\*\n");
for (j = 1; j < plane_x - 1; j++)
putchar(32);
printf("\* \*\n");
}
void game()//游戏主程序
{
int i = 0;
int isfire = 0;
int score = 0;//接收分数
int plane_x = 10;//飞机横坐标
int plane_y = 10;//飞机纵坐标
int target_x = 3;//目标横坐标
int target_y = 3;//目标纵坐标
int x = 0;
int y = 0;
srand((unsigned int)time(NULL));
target_x = rand() % 100 + 2;
target_y = rand() % (plane_y - 5) + 1;
target(target_x, target_y);
plane(plane_x, plane_y - target_y + 1, isfire);
while (1)
{
system(“cls”);
target(target_x, target_y);
plane(plane_x, plane_y, isfire);
for (i = 0; i < 20 - plane_y; i++)
printf(“\n”);
for (i = 0; i < 99; i++)
putchar(32);
printf(“score: %d\n”, score);
isfire = 0;
char key = _getch();
switch (key)//判断按键信息
{
case ‘w’:
case ‘W’:
plane_y–; break;
case ‘s’:
case ‘S’:
plane_y++; break;
case ‘a’:
case ‘A’:
plane_x–; break;
case ‘d’:
case ‘D’:
plane_x++; break;
case ’ ':
isfire = 1;
}
if (isfire && plane_x == target_x)//如果击中目标,生成下一个目标
{
target_x = rand() % 100 + 2;
target_y = rand() % (plane_y - 5) + 1;
score++;
}
if (key == ‘E’ || key == ‘e’)break;//如果按下E或e,结束本次游戏
}
}
void menu()//打印菜单栏
{
printf(“********************************\n”);
printf(“******(**play.1 exit.0*********\n”);
printf(“********************************\n”);
}
void test()//判断是否开始游戏
{
int i = 1;
while (i)
{
menu();
printf(“请玩家输入>\n”);
scanf(“%d”, &i);//用来接受1或0,以判断是否开始游戏
if (i == 1)
{
game();
}
else if (i != 0)
{
printf(“输入错误,请重新输入\n”);
}
}
printf(“退出游戏\n”);
}
int main()
{
test();
return 0;
}
## 总结
这个小游戏时比较简单的,各位可以自己尝试写出来,当然了,如果你还想练习其他的C语言游戏,可以关注我,我还写了简单的扫雷、三子棋游戏的制作。喜欢的就点个赞吧?


**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化资料的朋友,可以戳这里获取](https://bbs.youkuaiyun.com/topics/618545628)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
cs/618545628)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**