上一页 1 2 3 4 5 6 ··· 55 下一页
摘要: EasyX 提供的鼠标操作需要结合 Windows API 使用, 比较简陋。官方示例用法是在 // https://codebus.cn/yangw/mouse-operation。 Raylib 可以提供强大的多的鼠标操作。不过为了程序迁移的无痛感, 这里用 Raylib 重新实现了 "鼠标操作 阅读全文
posted @ 2023-01-26 14:52 ChrisZZ 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 基于 EasyX // 程序名称:星空 // 编译环境:Visual C++ 6.0,EasyX_20200902 // 最后更新:2009-2-22 // #include <graphics.h> #include <time.h> #include <conio.h> #define MAXS 阅读全文
posted @ 2023-01-26 14:47 ChrisZZ 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 字符阵是 EasyX 的经典样例程序: https://codebus.cn/yangw/character-matrix 使用 raylib 替代 easyx. 除了常规的 API 替换, 还需要额外调用 SwapScreenBuffer(). 由于 DrawText() / DrawTextEx 阅读全文
posted @ 2023-01-25 21:19 ChrisZZ 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 基于 EasyX // 根据《C和C++游戏趣味编程》第三章 别碰方块 写出 #include <graphics.h> #include <conio.h> // _kbhit() #include <stdio.h> // 检测按下了空格键 void demo_3_1_3() { while ( 阅读全文
posted @ 2023-01-25 20:32 ChrisZZ 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 基于 EasyX // 根据《C和C++游戏趣味编程》第10章 十字消除 写出 #include <graphics.h> #include <conio.h> // _kbhit() #include <stdio.h> #include <stdlib.h> #include <time.h> 阅读全文
posted @ 2023-01-25 20:30 ChrisZZ 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 这个简陋的小游戏,在 《C和C++游戏趣味编程》 第三章, 是逐次迭代写成的。这里贴出基于 easyx 和 raylib 的各自实现。 基于 EasyX // 根据《C和C++游戏趣味编程》第二章 仿真“自由落体小球” 写出 #include <graphics.h> #include <conio 阅读全文
posted @ 2023-01-25 20:28 ChrisZZ 阅读(59) 评论(0) 推荐(0) 编辑
摘要: Raylib 播放音频毫无压力, 相比之下 EasyX 需要借助 Windows API mciString 传入播放相关的命令, 感觉风格不统一, 不够优雅。 另一个问题是 clock() 和 CLOCKS_PER_SEC 在 Linux 下结果和 windows 相差了10倍, 需要手动处理下。 阅读全文
posted @ 2023-01-25 20:24 ChrisZZ 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 基于 EasyX // 根据《C和C++游戏趣味编程》第九章 推箱子 写出 #include <graphics.h> #include <conio.h> // _kbhit() #include <stdio.h> #include <stdlib.h> // 玩家位置 struct Playe 阅读全文
posted @ 2023-01-25 20:16 ChrisZZ 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 基于 EasyX // 根据《C和C++游戏趣味编程》第七章 贪吃蛇 写出 #include <graphics.h> #include <conio.h> // _kbhit() #include <stdio.h> #include <stdlib.h> // 全局变量定义 #define HE 阅读全文
posted @ 2023-01-25 20:13 ChrisZZ 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 思路 按如下顺序尝试: 绘制一个字符下落 绘制4个字符(一列)的下落 绘制20个字符(一列)的下落,并封装其位置更新、绘制的过程为 Rain 类的成员函数 绘制多个雨滴 每个雨滴在更新位置时, 也修改字符 每个雨滴初始化时,位置、速度都随即化 基于 EasyX // 字符雨 (基于 easyx) / 阅读全文
posted @ 2023-01-25 20:11 ChrisZZ 阅读(91) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 55 下一页