![](https://img-blog.csdnimg.cn/20210207150909449.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C/C++ 小游戏 源码
~一些自己写的小项目小游戏 不断更新 可能会有小bug 未发现 欢迎提出
小渝同学
一人一晚一奇迹 尸体竟是我自己
展开
-
跳动的小球.cpp
效果:跳动的小球,触碰到边界后,发出声音,并弹回。#include <stdio.h>#include <windows.h>#include <stdlib.h>//小球速度 int velocity_x = 1 ,velocity_y = 1;//小球初始位置int x=3,y=1;//显示棋盘与棋子 int left = 0,right = 20,top = 0,bottom =10;void show_board(void){ for(in原创 2021-02-15 19:36:11 · 137 阅读 · 0 评论 -
猜数字小游戏.cpp
猜数字小游戏.cpp功能:范围在1~100以内,正确则胜利结束,错误则给出提示信息思路://添加随机数种子//1. 系统生产随机数//2. 玩家进行猜测//3. 判断玩家猜测//猜对 退出//猜错 提示猜的结果 过大或者过小 返回第2步 游戏源码:#include <iostream>#include <ctime>#include <cstdlib>using namespace std;int main(){ //添加随机数原创 2021-02-07 17:34:07 · 101 阅读 · 0 评论 -
2048小游戏(Windows/ Linux版本)
1.0版本 Windows版本#include <stdio.h>//xiaoyk#include <time.h> //随机数种子time(0)头文件 #include <stdlib.h> //rand头文件 但是不加不知道为什么不报错 不影响使用 #include <windows.h> //system头文件 刷屏 #include <conio.h> //getch()头文件 int a[4][4]; //棋盘 i原创 2020-10-30 11:47:52 · 802 阅读 · 0 评论 -
五子棋2.1(3种版本)
#include <iostream> //yuxiao#include <stdlib.h> using namespace std;int q=1; //换人条件 q=1为@ ,q=0为# int s=0; //几子连线 char board[15][15]={ }; //棋盘数组 char role ='@'; //角色1 @角色2 # int key_x=7,key_y=7; //棋子位置 void init_board(voi原创 2020-09-30 09:32:47 · 201 阅读 · 0 评论 -
推箱子(C C++)
#include <iostream>#include <conio.h>#include <stdlib.h>#include <time.h> using namespace std;int main(){ //空格0=' ' 墙1='#' 目标3='O' 箱子4='M' 箱子到目标7='M' 小人到目标8='@' 小人5='@' int arr[8][8]={ {0,0,1,1,1,1,0,0}, {0,0,1,3,..原创 2020-09-29 14:36:56 · 122 阅读 · 0 评论 -
小老鼠走迷宫(C C++)
#include <iostream>#include <conio.h> //清屏头文件 #include <time.h> //时间头文件 using namespace std;int main(){ char maze[10][15]={ {'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'}, {'#','@','#',' ',' ',' ',' ',' ','#','原创 2020-09-28 20:31:32 · 860 阅读 · 0 评论