Created
June 13, 2017 14:55
-
-
Save Viza74/3af648c26a7dbd4d7c87003ac7833dd6 to your computer and use it in GitHub Desktop.
Multi file "build system" for TIC-80 (VS Code/OSX)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "--- Merging files..." | |
cat ./build/mergelist | |
cat ./build/mergelist | xargs -J % cat % > $1.lua | |
echo "\n--- Finished" | |
echo "$2/$1.tic -code $1.lua" | |
../tic.app/Contents/MacOS/tic $2/$1.tic -code $2/$1.lua -sprites sprites.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header.lua | |
globals.lua | |
pslib.lua | |
particles.lua | |
gameoverstate.lua | |
menustate.lua | |
gamestate.lua | |
bombstate.lua | |
compactstate.lua | |
swapstate.lua | |
shufflestate.lua | |
collectstate.lua | |
generatestate.lua | |
main.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "0.1.0", | |
"tasks": [ | |
{ | |
"taskName": "Merge to single file and run", | |
"command": "./build/merge.sh", | |
"isShellCommand": true, | |
"args": ["${workspaceRootFolderName}", "${workspaceRoot}"], | |
"showOutput": "always", | |
"echoCommand": true, | |
"isBuildCommand": true | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use these:
In VS Code, open the command palette, and start typing "task". Find "Tasks: Configure task runner", and press enter.
At "Select task runner" choose "Others". VS Code will create a hidden directory with a tasks.json file in your opened directory. Replace its contents with the tasks.json from here.
Create a subdirectory named "build", and place merge.sh, and mergelist inside it.
Modify merge.sh according to where you keep your tic.app (I keep it one dir up from my TIC80 projects, hence the "../")
The mergelist file here is just an example, modify as your project needs.
You will also need a tic file (with the same name as the project directory) and a sprites.gif in your directory, the launcher will use the tic file, inject the merged lua file and the sprites.gif to run. So basically the tic file only contains the map, sound and music information.
To build and run just press Cmd+Shift+b
The traces will show up VS Code
The shortcomings of this method: