buildcart.sh
- convenience script to build and run the game cartridgebuildwasm.sh
- convenience script to build and run the Wasm programMakefile
- convenience Makefile that builds the projectwasmdemo.wasmp
- TIC-80 Wasm 'script' file. Note the embedded game assets data at the end of the file.Define the environment variable WASI_SDK_PATH; e.g., if you installed WASI
into $HOME/wasi-sdk
, then export WASI_SDK_PATH=$HOME/wasi-sdk
.
Edit src/main.c
to implement your game. You are of course free to
organize your code in more than one C source file.
If you create sprites, map, music, etc., for your game, remember to
replace the game asset data at the end of wasmdemo.wasmp
with
your creations.
To build the Wasm file, execute make
. This generates cart.wasm
in the build directory. To run:
% tic80 --fs . --cmd 'load wasmdemo.wasmp & import binary cart.wasm & run & exit'
The script buildwasm.sh
contains above steps as a convenience.
To build a TIC-80 cartridge, first build the Wasm file, then build the cartridge file:
% tic80 --fs . --cmd 'load wasmdemo.wasmp & import binary cart.wasm & save game.tic & exit'
You can then run your cartridge as follows:
% tic80 --fs . --cmd 'load game.tic & run & exit'
The script buildcart.sh
does the above steps as a convenience.
TIC-80 API functions that merely duplicate standard library functionality are not imported. Please use the memcpy
and memset
functions provided by the C standard library instead.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。