Skip to content

The complete roguelike Tutorial from r/roguelikedev (2020 Go + BearLibTerminal, unfinished), (2024 Vanilla Javascript, finished), (2024 JS + Go + WASM, proof of concept)

License

Notifications You must be signed in to change notification settings

jolav/roguelike-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Complete Roguelike Tutorial from r/roguelikedev

"ID: in rainbow text: 'Roguelikedev does the Complete Roguelike Tutorial' and in gray text in the corner: 'v4.0 2020.6-7', over a grayscale ascii dungeon"

  1. Go + BearLibTerminal (incomplete)
  2. Javascript (full playable version)
  3. JS + Go WebAssembly (proof of concept)

Go-BearLibTerminal

CURRENT STATUS GIF

Part 4 + DIRECTIONAL FOV

Gif Part 5

CONTROLS

↑ Go Ahead
↓ Go Back
← Turn Left
→ Turn Right
ALT + ← Strafe Left
ALT + → Strafe Right

Compilation on Linux

  1. Install Go
  2. Download BearLibTerminal
  3. Put libBearLibTerminal.so into /usr/lib
  4. Move BearLibTerminal.go and BearLibterminal.h into roguelike-tutorial/bearlibterminal
  5. go mod init roguelike. Now you can import library using go modules import (blt "roguelike/bearlibterminal)
  6. go build -ldflags="-X 'main.releaseDate=$(date -u +%F_%T)'"

Cross Compile on Linux for Windows

  1. apt install gcc-mingw-w64-x86-64 gcc-multilib
  2. Put windows BearLibTerminal.dll and BearLibTerminal.lib into /usr/x86_64-w64-mingw32/lib
  3. 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

Distribution

LINUX

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 `

WINDOWS

Package in the same folder

  • roguelike.exe
  • BearLibTerminal.dll
  • assets folder

enter the folder and double click roguelike.exe

Javascript

CONTROLS

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

Go-Wasm

Proof of concept:

  • JS for canvas rendering
  • Go + WebAssembly for logic

About

The complete roguelike Tutorial from r/roguelikedev (2020 Go + BearLibTerminal, unfinished), (2024 Vanilla Javascript, finished), (2024 JS + Go + WASM, proof of concept)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published