~johanvandegriff/ruegolike

3bb8651e5d679e97cf7b693c70379243a91ae9ee — Johan Vandegriff 1 year, 4 months ago 3c2f3a3
added XYZ coordinate display
2 files changed, 5 insertions(+), 2 deletions(-)

M display.go
M main.go
M display.go => display.go +3 -0
@@ 1,6 1,7 @@
package main

import (
	"fmt"
	"math"

	"github.com/gdamore/tcell"


@@ 312,6 313,8 @@ func Display(s tcell.Screen, playerPos Position, visible *[height][width]bool, e
	style1 := tcell.StyleDefault.Foreground(tcell.ColorWhite).Background(tcell.ColorBlack)
	style2 := tcell.StyleDefault.Foreground(tcell.ColorDarkSlateGray).Background(tcell.ColorBlack)

	EmitStr(s, 0, 19, style1, fmt.Sprintf("coords:%02d,%02d,%02d", playerPos.x, playerPos.y, playerPos.z))

	rangeLimit := -1
	shadowcast(playerX, playerY, rangeLimit, visible, explored1, level)


M main.go => main.go +2 -2
@@ 99,12 99,12 @@ func main() {
				} else {
					EmitStr(s, 15, 0, style1, "oof!")
				}
			} else if ev.Rune() == '>' && (debug || dungeon.GetChar(playerPos) == '>') {
			} else if playerPos.z < depth-1 && ev.Rune() == '>' && (debug || dungeon.GetChar(playerPos) == '>') {
				playerPos.z++
				newPos := dungeon.GetLevel(playerPos.z).FindChar('<')
				playerPos.x = newPos.x
				playerPos.y = newPos.y
			} else if ev.Rune() == '<' && (debug || dungeon.GetChar(playerPos) == '<') {
			} else if playerPos.z > 0 && ev.Rune() == '<' && (debug || dungeon.GetChar(playerPos) == '<') {
				playerPos.z--
				newPos := dungeon.GetLevel(playerPos.z).FindChar('>')
				playerPos.x = newPos.x