From 64757d18c4b2669c46f2dc88293cf2f0ea1887db Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 21 Apr 2024 19:34:12 +0100 Subject: Add reversing --- tilemap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tilemap.go') diff --git a/tilemap.go b/tilemap.go index 281e76a..b24bdb6 100644 --- a/tilemap.go +++ b/tilemap.go @@ -56,7 +56,7 @@ func (tm *Tilemap) UpdateSurface() { func NewTilemap(layers [][]int, mapWidth int) Tilemap { tilemap := Tilemap{ tileSize: 16, - mapWidth: 15, + mapWidth: 25, } tilemap.layers = layers @@ -64,7 +64,7 @@ func NewTilemap(layers [][]int, mapWidth int) Tilemap { tilemap.surface = ebiten.NewImage(mapWidth*tilemap.tileSize, len(layers[0])/mapWidth*tilemap.tileSize) var err error - tilemap.tilesImage, _, err = ebitenutil.NewImageFromFile("Assets/Terrain/Terrain (16x16).png") + tilemap.tilesImage, _, err = ebitenutil.NewImageFromFile("tiles.png") if err != nil { log.Fatal(err) @@ -76,7 +76,7 @@ func NewTilemap(layers [][]int, mapWidth int) Tilemap { } func (tm * Tilemap) CalculateCollisions() { - for i, t := range tm.layers[1] { + for i, t := range tm.layers[0] { if t != 0 { x := i%tm.mapWidth * tm.tileSize y := i/tm.mapWidth * tm.tileSize -- cgit v1.2.1