- Go + BearLibTerminal (incomplete)
- Javascript (full playable version)
- JS + Go WebAssembly (proof of concept)
Part 4 + DIRECTIONAL FOV
↑ Go Ahead
↓ Go Back
← Turn Left
→ Turn Right
ALT + ← Strafe Left
ALT + → Strafe Right
- Install Go
- Download BearLibTerminal
- Put libBearLibTerminal.so into /usr/lib
- Move BearLibTerminal.go and BearLibterminal.h into roguelike-tutorial/bearlibterminal
go mod init roguelike
. Now you can import library using go modulesimport (blt "roguelike/bearlibterminal)
go build -ldflags="-X 'main.releaseDate=$(date -u +%F_%T)'"
apt install gcc-mingw-w64-x86-64 gcc-multilib
- Put windows BearLibTerminal.dll and BearLibTerminal.lib into /usr/x86_64-w64-mingw32/lib
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -ldflags="-X 'main.when=$(date -u +%F_%T)'" -o roguelike.exe
Package in the same folder
- roguelike binary
- libBearLibTerminal.so
- start.sh which contains
LD_LIBRARY_PATH="$(dirname "$0")" "$(dirname "$0")/roguelike"
- assets folder
enter the folder and execute ./start
`
Package in the same folder
- roguelike.exe
- BearLibTerminal.dll
- assets folder
enter the folder and double click roguelike.exe
NUMPAD
"1" -> DOWNLEFT
"2" -> DOWN
"3" -> DOWNRIGHT
"4" -> LEFT
"5" -> SKIP
"6" -> RIGHT
"7" -> UPLEFT
"8" -> UP
"9" -> UPRIGHT
KEYBOARD
"b" -> DOWNLEFT
"j" -> DOWN
"n" -> DOWNRIGHT
"h" -> LEFT
"t" -> SKIP
"l" -> RIGHT
"y" -> UPLEFT
"k" -> UP
"u" -> UPRIGHT
KEYBOARD
"q" -> LOOT
"1" -> EAT
"3" -> HEAL
"f" -> FIRE
"r" -> SELECT
Proof of concept:
- JS for canvas rendering
- Go + WebAssembly for logic