
EasyX游戏编程
文章平均质量分 68
BenBenBears
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
反弹球
运动中的球,碰撞墙壁后会45角反弹。// 反弹球.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "graphics.h"#include "conio.h"void main( ){ int x=5;//x方向上的移动距离,正负表示方向 int原创 2013-07-21 12:27:21 · 1330 阅读 · 0 评论 -
在格子上随机填入不重复的数字
屏幕上有 16x8 的方格,按随机顺序在将 1~128 的数字写到每个格子上。涉及到标记,可以应用在找配对等小游戏上。// 在格子上随机写数字.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "easyx.h"#include "stdio.h"#incl转载 2013-07-21 17:39:16 · 2062 阅读 · 0 评论 -
鼠标画选顶点画三角形
题目:画一个填充的三角形,要用鼠标点选三角形的三个顶点。提示:可以用 fillpoly 函数画多边形。// 三角形.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "graphics.h"#include "conio.h"void main( ){原创 2013-07-21 01:38:38 · 2363 阅读 · 0 评论 -
键盘、鼠标控制小球
题目:按下控制键时小球会惯性运动,通过鼠标来停住小球。待解决问题:GetMouseMsg调用时会出现阻塞,在鼠标不动的情况下,小球有时会无缘无故停住。// 鼠标控制.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "easyx.h"#include "c原创 2013-07-21 11:53:57 · 2733 阅读 · 0 评论 -
围棋棋盘
// 棋盘.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "easyx.h"#include "conio.h"void main( ){ int i,j; //初始化图形窗口 initgraph(548,548); //设置背景色为浅灰色原创 2013-07-22 00:08:51 · 1682 阅读 · 0 评论 -
变幻线
// 变幻线.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "easyx.h"#include "conio.h"#include "time.h"#define MAXPIXEL 10void main( ){ //初始化图形窗口 initg原创 2013-07-22 01:59:57 · 1129 阅读 · 0 评论 -
格子涂色
题目:2. 写一个“格子涂色”的游戏,要求:屏幕上有16x8的格子,屏幕底部有类似画笔中的选色区(随便放上一些常用的颜色),鼠标点击选择区的颜色后,就作为当前颜色,然后再点屏幕上的格子,就可以用刚才的颜色填涂相应格子。 // 鼠标画三角形.cpp : Defines the entry point for the console application.//#include "std原创 2013-07-21 00:39:33 · 5573 阅读 · 0 评论 -
在不破坏背景的情况下实现动态文字
一步一个脚印,先布置背景,再现实动态文字输出,再解决输出时破坏背景的问题,再优化代码。利用保护现场输出文本再恢复现场的方式实现以及代码的封装,值得在其他程序中尝试。// 实现动态文字.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "easyx.h"#i原创 2013-07-21 09:30:38 · 1262 阅读 · 0 评论