C / C++小游戏
C / C++小游戏
qiuqiuyaq
这个作者很懒,什么都没留下…
展开
-
Easyx-----c语言实现2048
tool.hpp 源.cpp原创 2022-06-25 21:00:24 · 1029 阅读 · 3 评论 -
Easyx-----c语言实现斗地主
tools.hpp源.cpp原创 2022-06-16 13:17:47 · 2792 阅读 · 12 评论 -
Easyx-----c++实现别踩白块双人版
#include <graphics.h>#include <conio.h>#include <stdio.h>#include <time.h>#include <string.h>#define MAXTASK 5 // 定义游戏需要完成的黑块数量// 定义宏 __sprintf 自适应 vc6 与 vc2013#if _MSC_VER > 1200#define __sprintf(.......原创 2022-05-24 15:45:18 · 501 阅读 · 2 评论 -
Easyx-----c语言实现图形化打砖块
#include<stdio.h> #include<conio.h>#include<easyx.h>#include<Windows.h>#define WINDOW_Width 768#define WINDOW_Height 1073 #define BrickWidth 81#define BrickHeight 27#define ROWS 5 //行#define COLS 8 //列enum bk {...原创 2022-04-08 12:49:58 · 1147 阅读 · 4 评论 -
c语言 --- 控制台推箱子
#include <stdio.h>#include <conio.h>#include <stdlib.h>int main(){ //printf("☆★○●◎◇◆□■△▲※\n"); /* ◎:把球推到箱子里 7 --->箱子从目的上推出来 ●:球 3 □: 箱子 4 ★: 人 5 ■: 墙 1 两个空格: 表示空地 .原创 2022-03-18 17:08:59 · 964 阅读 · 2 评论 -
Easyx-----c语言实现斗兽棋
原游戏链接:新斗兽棋_新斗兽棋html5游戏_4399h5游戏-h.4399.com #include<stdio.h>#include<easyx.h>#include<stdlib.h>#include<time.h>#define IMAGE_NUM_ANIMAL 8 //动物图片数量/* 动物类型枚举 从弱到强*/enum AnimalType{ AT_None, //没有 AT_Mouse, //老鼠 AT_C....原创 2022-03-16 22:28:36 · 5649 阅读 · 5 评论 -
Easyx-----c++实现控制台井字棋简单人机对弈
main.cpp#include"TicTacToe.h"int main() { Game game; game.getWinner(); return 0; }TicTacToe.h#pragma once#include<iostream>using namespace std;#include<array>#include<ctime>class Game{public: Game(); void print...原创 2022-03-06 09:43:20 · 812 阅读 · 1 评论 -
Easyx-----c++复刻新斗兽棋
原游戏链接:新斗兽棋_新斗兽棋html5游戏_4399h5游戏-h.4399.com common.h#pragma once#include <graphics.h>#include <iostream>#include <string>#include <map>#include<array>#include <list>#inclu......原创 2022-02-24 11:51:14 · 4421 阅读 · 0 评论 -
Easyx-----c++实现虚拟空调,清凉一夏
灵感来源:云空调,便携小空调-后记common.h#pragma once#include <graphics.h>#include <iostream>#include <map>#include <string>using namespace std;c++空调.cpp#include"DrawImg.h"#include"res.h"#include"button.h"int main(){......原创 2022-02-19 22:48:08 · 1010 阅读 · 2 评论 -
Easyx-----c语言实现烟花表白程序
效果图烟花爆炸效果思路 不能直接把烟花图片贴到窗口中,需要把烟花的像素点保存到二维数组中,以相同的半径大小把烟花输出到窗口中爆炸的位置,r从0开始,不断增大,一圈圈输出,从而达到爆炸的效果 烟花在窗口中爆炸的位置为(x,y)即烟花弹上升的最大高度 烟花圆心为(cx,cy),烟花半径为r,已知圆心和半径,求得圆上的每一个点的坐标:圆的参数方程:x=a+r*cosθ y=b+r*sinθ(θ∈ [0,2π) ) (a,b) 为圆心坐标,r 为圆半径,θ 为参数,(x,y).原创 2022-02-09 09:34:08 · 8495 阅读 · 7 评论 -
Easyx-----c语言实现简易版贪吃蛇
创建源文件选择.cppvs2019下载Easyx并包含头文件#include<graphics.h>Easyx图形库下载地址www.easyx.cn#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<graphics.h>#include<stdlib.h> //设置种子需要头文件stdlib.h#include<conio.h> //键盘操作的头文件....原创 2022-02-01 23:34:02 · 1043 阅读 · 0 评论 -
Easyx-----c++实现经典Windows扫雷
一些说明关于扫雷的基本实现,我在这篇博客已经详细介绍Easyx-----c语言实现简易版扫雷_考拉爱睡觉鸭~的博客-CSDN博客这里不再描述,主要是以c++单例设计模式的方式实现扫雷效果展示Common.h公共的头文件#pragma once#include <graphics.h>#include <iostream>#include <string>#include <map>#inc......原创 2022-01-21 00:39:30 · 4280 阅读 · 4 评论 -
Easyx-----c语言实现简易版扫雷
扫雷规则简介实现思路设置雷把以雷为中心的九宫格数据都+1,雷除外#include<stdio.h>#include<stdlib.h>#include<time.h>#include<easyx.h>#include<mmsystem.h>#pragma comment(lib, "winmm.lib")#define ROW 10 //定义行列的常量#define COL 10 #define Min..原创 2022-01-12 22:20:15 · 2576 阅读 · 5 评论 -
c++ --- 画线小工具
c++ --- 封装按钮类_考拉爱睡觉鸭~的博客-CSDN博客testDrawTool.cpp主函数部分#include "common.h"#include "widget.h"#include "button.h"#include "bightLine.h"int main() { Widget w(800, 800); //创建800*800的窗口 w.Show(); Basic_shape* pLine = ne......原创 2021-12-23 21:39:10 · 1131 阅读 · 0 评论 -
c++ --- 封装按钮类
鼠标操作 封装按钮 鼠标操作#include <graphics.h>#include <iostream>using namespace std; //鼠标反馈给程序的就是一个值,这个值在图形库的EASYXMSG结构体中/* 鼠标变量 EASYXMSG/ExMessage typedef ExMessage EASYXMSG(起别名)*/int main() { initgraph(4......原创 2021-12-23 17:45:23 · 3320 阅读 · 2 评论 -
Easyx-----c语言实现球球大作战
创建源文件选择.cppvs2019下载Easyx并包含头文件#include<graphics.h>Easyx图形库下载地址www.easyx.cn//玩家,食物,属性:坐标(x,y),颜色,球:radius半径,判断食物是否存在:标志falg.//用结构体描述同一类事物#include <stdio.h>#include <time.h>#include<conio.h>#include<graphics.........原创 2021-12-29 01:22:43 · 1695 阅读 · 0 评论 -
Easyx-----c++实现推箱子
学会如何封装 学会容器基本使用 熟悉多文件开发 #pragma once//资源文件不需要重复new一个对象#include "common.h"//单例设计模式//1.构造函数私有化//2.提供一个静态接口class Res{public: static map<string, IMAGE*> img; static map<string, string> music; static void drawIMG(int x, int..原创 2021-12-22 16:40:49 · 1270 阅读 · 3 评论 -
Easyx-----c语言实现打砖块
效果如下:创建源文件选择.cppvs2019下载Easyx并包含头文件 Easyx图形库下载地址www.easyx.cn项目->属性->高级->字符集改为多字节字符集#include<graphics.h>~把图片和含有.cpp文件夹放在一起~准备就绪 上代码#include<stdio.h>#include<graphics.h>#incl......原创 2021-11-18 03:49:12 · 1587 阅读 · 3 评论 -
Easyx-----c语言实现皮卡丘移动控制
用贴图方式,实现皮卡丘按键盘上键丢球,按右键翻滚效果如下:创建源文件选择.cppvs2019下载Easyx并包含头文件~项目->属性->字符集改为多字节字符集#include<graphics.h>小知识:绝对路径选择文件夹,右键->属性->位置也可以用相对路径把图片和含有.cpp文件夹放在一起准备就绪 上代码#include<stdio.h>#include&l......原创 2021-11-18 03:32:16 · 3524 阅读 · 3 评论