From 5fe8960b575f5b0216faafe496a2a9927fb1bb9c Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 23 Apr 2024 14:46:27 +0100 Subject: add menu --- level.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'level.go') diff --git a/level.go b/level.go index bdbb8fc..5baef9e 100644 --- a/level.go +++ b/level.go @@ -5,6 +5,13 @@ import ( ) func StartGame(g *Game) { + //g.state = IN_GAME + g.player = NewPlayer(g, 4 * tileSize, 9 * tileSize) + g.objects = append(g.objects, g.player) + g.exit = NewExit(g, 21 * tileSize, 9 * tileSize) + g.objects = append(g.objects, g.exit) + + g.ResetAll() StartLevel1(g) } @@ -43,7 +50,7 @@ func noMoveable(g *Game) { func StartLevel1(g *Game ) { - g.SetInGame() + //g.SetInGame() tilemap := NewTilemap([][]int{ { @@ -206,6 +213,8 @@ func StartLevel5(g *Game) { //g.toPlace = append(g.toPlace, NewSpring(g, 0, 0)) g.exit.movable = true + g.toPlace = append(g.toPlace, g.exit) + g.RemoveObject(g.exit) g.toPlace = append(g.toPlace, NewSpring(g, 0, 0)) // after end g.QueueState(ReverseLevel) -- cgit v1.2.1