当前位置:网站首页>用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 一起进步,更多优质的学习教程持续更新~
边栏推荐
- Research Report on medical toilet industry - market status analysis and development prospect forecast
- Cost accounting [14]
- csapp shell lab
- 12306: mom, don't worry about me getting the ticket any more (1)
- Cost accounting [18]
- Mysql database (III) advanced data query statement
- UCORE lab5 user process management experiment report
- Crawler series of learning while tapping (3): URL de duplication strategy and Implementation
- Es6--- two methods of capturing promise status as failed
- Hospital privacy screen Industry Research Report - market status analysis and development prospect forecast
猜你喜欢
ucore lab5
Word macro operation: convert the automatic number in the document into editable text type
Interface test interview questions and reference answers, easy to grasp the interviewer
Learning record: how to perform PWM output
Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]
Visual analysis of data related to crawling cat's eye essays "sadness flows upstream into a river" | the most moving film of Guo Jingming's five years
Mysql database (I)
Take you to use wxpy to create your own chat robot (plus wechat interface basic data visualization)
ucore lab 2
C语言学习笔记
随机推荐
Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
China's PCB connector market trend report, technological innovation and market forecast
Cost accounting [13]
Learning record: USART serial communication
程序员的你,有哪些炫技的代码写法?
ucore lab 2
Accounting regulations and professional ethics [5]
LeetCode#118. Yanghui triangle
LeetCode#2062. Count vowel substrings in strings
Leetcode notes - dynamic planning -day7
cs零基础入门学习记录
LeetCode#412. Fizz Buzz
MATLAB实例:阶跃函数的两种表达方式
学习记录:串口通信和遇到的错误解决方法
Research Report on medical anesthesia machine industry - market status analysis and development prospect prediction
STM32學習記錄:輸入捕獲應用
JDBC introduction
力扣刷题记录
ucore Lab 1 系统软件启动过程
Cost accounting [13]