~johanvandegriff/ruegolike

f2dd2fa0ed66a17e5f9ae7829aa1ce22f4e94452 — Johan Vandegriff a year ago 9730d80
tweaked the chars displayed and the movement keys, updated roadmap
5 files changed, 131 insertions(+), 59 deletions(-)

M DEV.md
M chars.txt
M display.go
M generate.go
M main.go
M DEV.md => DEV.md +61 -4
@@ 24,7 24,7 @@ Update: looks like RogueBasin has a similar [article](http://roguebasin.roguelik
* display the player, highlighted 

### player verbs
* move: numpad/hjklyubn/qweasdzxc/click screen?
* move: numpad/arrow keys/p[;' (diagonals)/click screen





@@ 55,11 55,13 @@ Update: looks like RogueBasin has a similar [article](http://roguebasin.roguelik

## level 2: message system
### player verbs
* view message log: m
* view message log: m (actually not implemented until tabs)
### messages
* running into a wall: "oof!"
* going up stairs: "you walk up the stairs"
* going down stairs: "you walk down the stairs"
* entering a new level: "this level you have entered looks completely new to you"
* note: must deal with multiple messages with "--more--"





@@ 83,6 85,8 @@ Update: looks like RogueBasin has a similar [article](http://roguebasin.roguelik
* death

### messages
* "an enemy approaches you"
* "you approach an enemy"
* "the enemy hits you"
* "you hit the enemy"
* "the enemy kicks you"


@@ 100,11 104,11 @@ Update: looks like RogueBasin has a similar [article](http://roguebasin.roguelik
### player verbs
* pick up: ,
* drop: d
* equip: e
* unequip: u
* equip/unequip: e
* throw: t
* kick: k
	* kicking an item will propel it forward
	* kicking a creature will attack it, not adding your weapon damage

### status
* inventory sidebar


@@ 112,10 116,63 @@ Update: looks like RogueBasin has a similar [article](http://roguebasin.roguelik
* AC


##level 5: tabs
### display
* tabbed interface on the right

### tabs
* tutorial/instructions/help
* inventory
* list of player verbs
* message history

### player verbs
* view inventory: i
* view message history: m
* view help tab: ?
* view any tab: click








##level X:
### tiles
* 

### creatures
* 

### generation
* 

### display
* 

### player verbs
* 

### messages
* 

### status
* 

### tabs
* 







# things to add
* autowalk when screen clicked
* give more info when screen right clicked
* message system
* goal/win condition
* can of grease, duct tape

M chars.txt => chars.txt +8 -1
@@ 5,4 5,11 @@ rounded:
╭ ╰ ╮ ╯

misc:
£
\ No newline at end of file
£≈
─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼
═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╙ ╛ ╚ ╛ ╜ ╝ ╞ ╟ ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬
▀ ▄ █ ▌ ▐ ░ ▒ ▓ ■ □ ▪ ▫ ▬ ○ ◌ ● ◘ ◙ ◦ ☺ ☻ ☼ ◊ •

⟠ ⧫ ◊ • : ▪ ▫ ▮ ▯

↑ ↓ ⇑ ⇓ ◭ ⧩ ⧨ ◮ ▴ ▾
\ No newline at end of file

M display.go => display.go +12 -0
@@ 665,6 665,18 @@ func Display(s tcell.Screen, playerPos Position, visible *[height][width]bool, e
						}
					}
				}
				if char == '*' {
					char = '▪'
				}
				if char == '<' {
					char = '▴' //'▲' //'↑'
				}
				if char == '>' {
					char = '▾' //'▼' //'↓'
				}
				if char == '#' {
					char = '█'
				}
				if visible[y][x] {
					s.SetContent(x+offsetX, y+offsetY, char, nil, style1)
				} else {

M generate.go => generate.go +1 -1
@@ 274,7 274,7 @@ func tryDrawCorridor(i1, i2 int, rooms []room, level *Level) bool {
		if c == '─' || c == '│' {
			level.SetChar(pt, '*')
		} else if c == ' ' {
			level.SetChar(pt, ':')
			level.SetChar(pt, '░') //'▒'
		}
	}


M main.go => main.go +49 -53
@@ 58,61 58,57 @@ func main() {
			}
			EmitStr(s, 0, 0, style1, fmt.Sprintf("%c", ev.Rune()))
			EmitStr(s, 2, 0, style1, fmt.Sprintf("%s                   ", ev.Name()))
			var deltaX, deltaY int
			if ev.Name() == "Left" {
				deltaX, deltaY = -1, 0
			} else if ev.Name() == "Right" {
				deltaX, deltaY = 1, 0
			} else if ev.Name() == "Up" {
				deltaX, deltaY = 0, -1
			} else if ev.Name() == "Down" {
				deltaX, deltaY = 0, 1
			} else if ev.Rune() == '1' {
				deltaX, deltaY = -1, 1
			} else if ev.Rune() == '2' {
				deltaX, deltaY = 0, 1
			} else if ev.Rune() == '3' {
				deltaX, deltaY = 1, 1
			} else if ev.Rune() == '4' {
				deltaX, deltaY = -1, 0
			} else if ev.Rune() == '5' {
				deltaX, deltaY = 0, 0
			} else if ev.Rune() == '6' {
				deltaX, deltaY = 1, 0
			} else if ev.Rune() == '7' {
				deltaX, deltaY = -1, -1
			} else if ev.Rune() == '8' {
				deltaX, deltaY = 0, -1
			} else if ev.Rune() == '9' {
				deltaX, deltaY = 1, -1
			}
			if deltaX != 0 || deltaY != 0 {
				newPlayerX := playerPos.x + deltaX
				newPlayerY := playerPos.y + deltaY

				if newPlayerX >= 0 && newPlayerX < width &&
					newPlayerY >= 0 && newPlayerY < height &&
					!dungeon.GetTile(Position{newPlayerX, newPlayerY, playerPos.z}).IsSolid() {
					playerPos.x = newPlayerX
					playerPos.y = newPlayerY
					EmitStr(s, 15, 0, style1, "    ")
				} else {
					EmitStr(s, 15, 0, style1, "oof!")
				}
			} 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 playerPos.z > 0 && ev.Rune() == '<' && (debug || dungeon.GetChar(playerPos) == '<') {
				playerPos.z--
				newPos := dungeon.GetLevel(playerPos.z).FindChar('>')
				playerPos.x = newPos.x
				playerPos.y = newPos.y
			}
			//TODO fast travel command (or click mouse)
			processMoveEvent(ev.Name(), ev.Rune(), &playerPos, dungeon, s, style1)
		}

		Display(s, playerPos, &visible, &explored[playerPos.z], dungeon.GetLevel(playerPos.z))
	}
}

func processMoveEvent(evName string, evRune rune, playerPos *Position, dungeon *Dungeon, s tcell.Screen, style1 tcell.Style) {
	var deltaX, deltaY int
	if evRune == '1' || evRune == ';' {
		deltaX, deltaY = -1, 1
	} else if evRune == '2' || evName == "Down" {
		deltaX, deltaY = 0, 1
	} else if evRune == '3' || evRune == '\'' {
		deltaX, deltaY = 1, 1
	} else if evRune == '4' || evName == "Left" {
		deltaX, deltaY = -1, 0
	} else if evRune == '5' {
		// deltaX, deltaY = 0, 0 //TODO run
	} else if evRune == '6' || evName == "Right" {
		deltaX, deltaY = 1, 0
	} else if evRune == '7' || evRune == 'p' {
		deltaX, deltaY = -1, -1
	} else if evRune == '8' || evName == "Up" {
		deltaX, deltaY = 0, -1
	} else if evRune == '9' || evRune == '[' {
		deltaX, deltaY = 1, -1
	}
	if deltaX != 0 || deltaY != 0 {
		newPlayerX := playerPos.x + deltaX
		newPlayerY := playerPos.y + deltaY

		if newPlayerX >= 0 && newPlayerX < width &&
			newPlayerY >= 0 && newPlayerY < height &&
			!dungeon.GetTile(Position{newPlayerX, newPlayerY, playerPos.z}).IsSolid() {
			playerPos.x = newPlayerX
			playerPos.y = newPlayerY
			EmitStr(s, 15, 0, style1, "    ")
		} else {
			EmitStr(s, 15, 0, style1, "oof!")
		}
	} else if playerPos.z < depth-1 && (evRune == '.' || evRune == '>') && (debug || dungeon.GetChar(*playerPos) == '>') {
		playerPos.z++
		newPos := dungeon.GetLevel(playerPos.z).FindChar('<')
		playerPos.x = newPos.x
		playerPos.y = newPos.y
	} else if playerPos.z > 0 && (evRune == '.' || evRune == '<') && (debug || dungeon.GetChar(*playerPos) == '<') {
		playerPos.z--
		newPos := dungeon.GetLevel(playerPos.z).FindChar('>')
		playerPos.x = newPos.x
		playerPos.y = newPos.y
	}
	//TODO fast travel command (or click mouse)
}