当前位置:网站首页>用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 of pharmaceutical solvent industry - market status analysis and development prospect prediction
- Servlet
- Learning record: use STM32 external input interrupt
- 力扣刷题记录
- Accounting regulations and professional ethics [2]
- C语言数组的概念
- Stm32 dossiers d'apprentissage: saisie des applications
- 学习记录:理解 SysTick系统定时器,编写延时函数
- LeetCode#268. Missing numbers
- 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
猜你喜欢

STM32学习记录:玩转按键控制蜂鸣器和LED

ucorelab3

学习记录:TIM—基本定时器

Jupyter installation and use tutorial

学习记录:TIM—电容按键检测

Learning records: serial communication and solutions to errors encountered

Stm32 dossiers d'apprentissage: saisie des applications

ucore lab 6

Lab 8 file system

Eslint--- error: newline required at end of file but not found (EOL last) solution
随机推荐
Brief introduction to libevent
Cost accounting [13]
What are the commonly used SQL statements in software testing?
学习记录:使用STM32F1看门狗
C4D quick start tutorial - Introduction to software interface
ucorelab4
Crawler series of learning while tapping (3): URL de duplication strategy and Implementation
动态规划前路径问题
C 基本语法
Cost accounting [16]
Intensive learning notes: Sutton book Chapter III exercise explanation (ex17~ex29)
Es6---es6 content details
12306: mom, don't worry about me getting the ticket any more (1)
Winter vacation daily question - maximum number of balloons
Leetcode notes - dynamic planning -day6
Preface to the foundations of Hilbert geometry
Learning record: STM32F103 clock system overview working principle
学习记录:如何进行PWM 输出
Cost accounting [22]
[C language] twenty two steps to understand the function stack frame (pressing the stack, passing parameters, returning, bouncing the stack)