当前位置:网站首页>用C语言写网页游戏
用C语言写网页游戏
2022-07-06 09:25:00 【编程小鱼六六六】
1. 下载PainterEngine
2. 我们以一个PainterEngine的狐狸跑酷游戏为例
3. 安装mingw配置好环境变量
安装emscripten(请参阅网上教程),教程中假设已经安装到了D:\emsdk
4. Windows打开命令提示符输入以下命令
D:
emsdk\emsdk_env.bat
emcc -v
验证Emscripten是否能正常工作,如果成功,你可以看到以下的界面
然后打开emsdk\upstream\emscripten\src\setting.js
修改INITIAL_MEMORY为268435456(此项参数为程序运行分配的内存空间大小)
5. 用文本文件格式打开PainterEngine\platform\webassembly\makefile,修改游戏project目录所在的文件路径
5. 将你project\assets需要用到的文件放在PainterEngine\platform\webassembly\assets目录下(这样就可以通过assets/filename的方式读取该文件)
6. 在命令提示符输入
cd PainterEngine\platform\webassembly\
7. 在命令提示符输入
emmake make
然后等待编译完成,当你看到如下界面时,提示项目已编译成功
8.现在,你可以通过在浏览器输入查看编译结果了
下面的网页,就是游戏编译的结果,你可以直接玩耍了
C/C++入门视频,提供给零基础的小伙伴进行C语言入门学习,学习C/C++编程知识,欢迎关注UP,也可以进入UP的企鹅学习群:828339809 一起进步,更多优质的学习教程持续更新~
边栏推荐
- Cost accounting [20]
- How to change XML attribute - how to change XML attribute
- Learning record: understand systick system timer and write delay function
- Learning record: USART serial communication
- What if software testing is too busy to study?
- JS --- BOM details of JS (V)
- Accounting regulations and professional ethics [3]
- Mysql database (II) DML data operation statements and basic DQL statements
- [C language] twenty two steps to understand the function stack frame (pressing the stack, passing parameters, returning, bouncing the stack)
- 学习记录:理解 SysTick系统定时器,编写延时函数
猜你喜欢
What are the software testing methods? Show you something different
基于485总线的评分系统
How to become a good software tester? A secret that most people don't know
C语言学习笔记
STM32学习记录:输入捕获应用
ucorelab3
力扣刷题记录
The wechat red envelope cover designed by the object is free! 16888
ucorelab4
STM32 learning record: play with keys to control buzzer and led
随机推荐
JS --- detailed explanation of JS DOM (IV)
How to do agile testing in automated testing?
Mysql database (I)
Knowledge that you need to know when changing to software testing
Research Report on market supply and demand and strategy of China's medical chair industry
LeetCode#268. Missing numbers
Leetcode notes - dynamic planning -day6
ucore Lab 1 系统软件启动过程
Learning record: use stm32f1 watchdog
C4D quick start tutorial - Introduction to software interface
Cost accounting [24]
Winter vacation daily question - maximum number of balloons
Accounting regulations and professional ethics [3]
Cost accounting [13]
Cost accounting [19]
JS --- detailed explanation of JS facing objects (VI)
Automated testing problems you must understand, boutique summary
LeetCode#19. Delete the penultimate node of the linked list
Word macro operation: convert the automatic number in the document into editable text type
动态规划前路径问题