summaryrefslogtreecommitdiff
path: root/tilemap.go
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-04-21 19:34:12 +0100
committerdavidovski <david@davidovski.xyz>2024-04-21 19:34:12 +0100
commit64757d18c4b2669c46f2dc88293cf2f0ea1887db (patch)
tree865a8fe4fb25180583ebf93fca40073c3d48822e /tilemap.go
parent1f1c464f84a169ea5146d360ae6b1211d8a7074f (diff)
Add reversing
Diffstat (limited to 'tilemap.go')
-rw-r--r--tilemap.go6
1 files changed, 3 insertions, 3 deletions
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