Character loaded form saved position jumps Into old default position
Hi I set up a save for a tile based game to save the character position, it works the load and save but when I move the character from the loaded position it jumps into the old default position tile it was on before the load but I need it to be able to move from the new loaded spot.
I'm using ActionScript 2.0.
Save
PHP Code:
on (release){
_root.pos = SharedObject.getLocal("game");
_root.pos.data.charx = _root.tiles.char._x;
_root.pos.data.chary = _root.tiles.char._y;
_root.pos.data.xtile = _root.xtile._x;
_root.pos.data.ytile = _root.ytile._y;
}
Load
PHP Code:
on (release){
_root.pos = SharedObject.getLocal("game");
_root.tiles.char._x = _root.pos.data.charx;
_root.tiles.char._y = _root.pos.data.chary;
_root.xtile._x = _root.pos.data.xtile;
_root.ytile._y = _root.pos.data.ytile;
}