merge changes
This commit is contained in:
		@@ -62,10 +62,34 @@ func main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	setupLayers(mw)
 | 
						setupLayers(mw)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	level := gamemap.NewLevel(mainCtx, "test", 1)
 | 
						//fixme
 | 
				
			||||||
	level = mapgens.DefaultGen(level)
 | 
						level, rooms := mapgens.DefaultGen(gamemap.NewLevel(mainCtx, "test", 1))
 | 
				
			||||||
	vp := mainwindow.NewViewPort(40, 0, 60, 47, level, mw.GetLayer("base"))
 | 
						State.Level = level
 | 
				
			||||||
	vp.Render()
 | 
						vp := mainwindow.NewViewPort(30, 0, 70, 47, mw.GetLayer("base"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						screenMgr := types.NewScreenManager(mainCtx)
 | 
				
			||||||
 | 
						screenMgr.AddScreen("title", &screens.TitleScreen{})
 | 
				
			||||||
 | 
						screenMgr.AddScreen("game", screens.NewGameScreen(mw, &State, vp))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						screenMgr.SetScreenByName("game")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//fixme
 | 
				
			||||||
 | 
						//player := &mob.Player{
 | 
				
			||||||
 | 
						//	Mob: mob.Mob{
 | 
				
			||||||
 | 
						//		Appearance: &types.Appearance{
 | 
				
			||||||
 | 
						//			Glyph: &types.PlainGlyphHolder{"@"},
 | 
				
			||||||
 | 
						//			ColorSet: &types.TileColorSet{
 | 
				
			||||||
 | 
						//				Fg:     &types.PlainColorHolder{255, 255, 255, 255},
 | 
				
			||||||
 | 
						//			},
 | 
				
			||||||
 | 
						//		},
 | 
				
			||||||
 | 
						//		Coords: rooms[0].Center,
 | 
				
			||||||
 | 
						//		BlocksPass: true,
 | 
				
			||||||
 | 
						//	},
 | 
				
			||||||
 | 
						//}
 | 
				
			||||||
 | 
						//State.Player = player
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//vp.PlayerCoords = player.Coords
 | 
				
			||||||
 | 
						//vp.Render(&State)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go decodeInput(mainCtx, mw.GetLayer("base"))
 | 
						go decodeInput(mainCtx, mw.GetLayer("base"))
 | 
				
			||||||
	go vp.Listen(State)
 | 
						go vp.Listen(State)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,8 @@ import (
 | 
				
			|||||||
	"math"
 | 
						"math"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//fixme store separate FovMap, add method IsInMap to it
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type FieldOfVision struct {
 | 
					type FieldOfVision struct {
 | 
				
			||||||
	cosTable    map[int]float64
 | 
						cosTable    map[int]float64
 | 
				
			||||||
	sinTable    map[int]float64
 | 
						sinTable    map[int]float64
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,6 +54,7 @@ func NewLevel(ctx util.ClientCtx, branch string, depth int) *Level {
 | 
				
			|||||||
		Depth:    depth,
 | 
							Depth:    depth,
 | 
				
			||||||
		Rect: types.NewRect(0,0, mapWidth, mapHeight),
 | 
							Rect: types.NewRect(0,0, mapWidth, mapHeight),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	l.Tiles = make([]*Tile, l.W*l.H)
 | 
						l.Tiles = make([]*Tile, l.W*l.H)
 | 
				
			||||||
	ctx.Logger().Debug().Msgf("Generating level of branch %s depth %d", branch, depth)
 | 
						ctx.Logger().Debug().Msgf("Generating level of branch %s depth %d", branch, depth)
 | 
				
			||||||
	return l
 | 
						return l
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user