reflection goes out of the window

This commit is contained in:
2019-11-10 01:24:45 +03:00
parent bc00262ead
commit f442dc6921
16 changed files with 87 additions and 63 deletions

View File

@ -83,12 +83,12 @@ func (ts *GameScreen) Render() {
func (ts *GameScreen) walk(state *gamestate.GameState, dx, dy int) {
controller := state.Controller
coords := controller.GetComponent(state.Player, types.Coords{}.TypeOf()).(types.Coords)
coords := controller.GetComponent(state.Player, ecs.CoordsComponent).(types.Coords)
newCoords := types.Coords{coords.X + dx, coords.Y + dy}
movable := controller.GetComponent(state.Player, movement.Moveable{}.TypeOf()).(movement.Moveable)
movable := controller.GetComponent(state.Player, ecs.MoveableComponent).(movement.Moveable)
if !movable.IsBlocked(newCoords) {
controller.UpdateComponent(state.Player, types.Coords{}.TypeOf(), newCoords)
controller.UpdateComponent(state.Player, ecs.CoordsComponent, newCoords)
}
state.Redraw <- struct{}{}

View File

@ -29,7 +29,9 @@ func (ts *TitleScreen) Exit() {
blt.Clear()
}
func (ts *TitleScreen) Render() {
blt.PrintExt(0, 0, ts.mw.W, ts.mw.H, 15, logo)
blt.PrintExt(0, 2, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, logo)
blt.PrintExt(0, 19, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, menu)
blt.PrintExt(0, 35, ts.mw.W, ts.mw.H, 3, credits)
}
var logo = `
@ -45,8 +47,9 @@ var logo = `
;k. .Ox Ok..'.,l ;Kk:;dk cKl lX: dKc,;oc kx kk OO dKl;lk: .0O
l; ,o .kK0KKK; :Ok; c; l: .oxc. x: Ol xl .dk: .o
`
var menu = `
Alchemyst (c) 2011-2014 thefish <thefish@zaar.be>
@ -55,9 +58,9 @@ Alchemyst (c) 2011-2014 thefish <thefish@zaar.be>
[color=green]L[/color]oad saved game
Read [color=green]h[/color]elp file
Highest [color=green]S[/color]cores
`
var credits = `
Roguebasin Libtcod Tutorial (c) 2010-2011, Jotaf Henriques
Brogue 1.3 (c) 2010 Brian Walker
Madness (c) 2010 hmp <humpolec@gmail.com>