当前位置:网站首页>用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 一起进步,更多优质的学习教程持续更新~
边栏推荐
- 数据在内存中的存储&载入内存,让程序运行起来
- LeetCode#19. Delete the penultimate node of the linked list
- ucorelab3
- [C language] twenty two steps to understand the function stack frame (pressing the stack, passing parameters, returning, bouncing the stack)
- How to become a good software tester? A secret that most people don't know
- 力扣刷题记录
- Market trend report, technical innovation and market forecast of geosynthetic clay liner in China
- 学习记录:USART—串口通讯
- ucore lab 6
- JS --- detailed explanation of JS facing objects (VI)
猜你喜欢
[C language] twenty two steps to understand the function stack frame (pressing the stack, passing parameters, returning, bouncing the stack)
How to do agile testing in automated testing?
ucorelab4
C语言学习笔记
LeetCode#36. Effective Sudoku
LeetCode#19. Delete the penultimate node of the linked list
学习记录:使用STM32F1看门狗
CSAPP shell lab experiment report
MATLAB实例:阶跃函数的两种表达方式
学习记录:TIM—电容按键检测
随机推荐
STM32 learning record: input capture application
STM32學習記錄:輸入捕獲應用
UCORE lab5 user process management experiment report
Perinatal Software Industry Research Report - market status analysis and development prospect forecast
学习记录:使用STM32外部输入中断
Cost accounting [17]
编程到底难在哪里?
Scoring system based on 485 bus
TCP的三次握手与四次挥手
The wechat red envelope cover designed by the object is free! 16888
数据在内存中的存储&载入内存,让程序运行起来
Research Report on pharmaceutical R & D outsourcing service industry - market status analysis and development prospect forecast
ucore lab7
Cost accounting [23]
China's salt water membrane market trend report, technological innovation and market forecast
JS --- all basic knowledge of JS (I)
Research Report of pharmaceutical solvent industry - market status analysis and development prospect prediction
JS --- BOM details of JS (V)
C语言是低级和高级的分水岭
Printing quality inspection and verification system Industry Research Report - market status analysis and development prospect forecast