202010-08 基于easyx的C++实现贪吃蛇 本文实例为大家分享了基于easyx的C++实现贪吃蛇的具体代码,供大家参考,具体内容如下本代码来自于easyx讨论群的分享先上效果图,其实也只是画了简单的圈圈代表蛇和食物,背景就是黑色的。#include"stdafx.h"#include<iostream>#include<stdlib.h>#include<time.h>#include<conio.h>#include<graphics.h>#defineN100usingnamespacestd;enummoved{UP,DOWN,LEFT,RIGHT};classSnake{private:struct{//整条... 继续阅读 >
202010-08 C++基于easyx图形库实现推箱子游戏 本文实例为大家分享了C++实现推箱子游戏的具体代码,供大家参考,具体内容如下头文件:#include<stdio.h>#include<stdlib.h>//#include<Windows.h>#include<conio.h>#include<graphics.h>#include<stdbool.h>//播放音乐需要的头文件#include<mmsystem.h>#pragmacomment(lib,"winmm.lib")//格子边长#defineSPACE60//6.3.1定义变量IMAGEpng[12];//5张图,定义5个变量,定义一个数组#defineMapMany6//枚举方向enumCH{... 继续阅读 >
202009-23 C++基于EasyX图形库实现2048小游戏 C++和EasyX图形库,实现2048小游戏,供大家参考,具体内容如下MainGame2048.cpp/**Name:Game2048CoreClass*/#include<iostream>#include<graphics.h>#include<stdio.h>#include<windows.h>#include<conio.h>#include<stdio.h>#include"Game2048.h"#defineBLOCK_SIZE60#defineSIZE_COL10#defineSIZE_ROW10usingnamespacestd;voidDisplayMap(Game2048&mygame);intGetMove();intmain(intargc,char*argv[]){HWND... 继续阅读 >
202009-23 C++基于EasyX实现简单扫雷游戏 本文实例为大家分享了C++EasyX实现简单扫雷游戏的具体代码,供大家参考,具体内容如下【实现代码】#include<cmath>#include<time.h>#include<easyx.h>#include<conio.h>usingnamespacestd;#defineSize500//定义窗口大小#defineSquareSize50//定义格子大小#defineBackGroundColorLIGHTGRAY//定义背景颜色constintN=Size/SquareSize;//设置地图大小为N*NconstintNum=N*N/5;//设置总地雷数intnum... 继续阅读 >