4 Star 4 Fork 0

Gitee 极速下载/tic-80

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/nesbox/TIC-80
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

C Starter Project Template

Pre-requisites

Files in this template

  • buildcart.sh - convenience script to build and run the game cartridge
  • buildwasm.sh - convenience script to build and run the Wasm program
  • Makefile - convenience Makefile that builds the project
  • wasmdemo.wasmp - TIC-80 Wasm 'script' file. Note the embedded game assets data at the end of the file.

Building your game

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.

Additional Notes

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.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/tic-80.git
git@gitee.com:mirrors/tic-80.git
mirrors
tic-80
tic-80
main

搜索帮助