diff options
author | davidovski <david@davidovski.xyz> | 2024-04-21 19:34:12 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2024-04-21 19:34:12 +0100 |
commit | 64757d18c4b2669c46f2dc88293cf2f0ea1887db (patch) | |
tree | 865a8fe4fb25180583ebf93fca40073c3d48822e /tilemap.go | |
parent | 1f1c464f84a169ea5146d360ae6b1211d8a7074f (diff) |
Add reversing
Diffstat (limited to 'tilemap.go')
-rw-r--r-- | tilemap.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |