I've having some fun working on a Sokoban clone. And now I'm reworking it from having one hardcoded level to load levels from files.
I've made a type to represent a tile in the level and I store these in an array.
Type Tile
X
Y
IsWall
Crate
Target
EndType
tiles As Tile[]
The Crate property is the ID for a sprite that represents a crate if the crate is on that tile. When the player moves a crate I move it using SetSpriteTweenX and Y and then I thought I do something along the lines of
tiles[j].Crate = tiles[i].Crate
tiles[i].Crate = 0
Thus updating the array on where the crate moved. However nothing happens when I do that, the array doesn't change. I tried to switch the position of the tiles but that doesn't seem to work either.
Any suggestions on what I'm doing wrong?