1 decade ago by Gamma
How do I make the player stay in the same spot where I left off while then closing the browser and still being in that exact spot.
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
// main.js storage: new ig.Storage(), positionSnapshotTimer: new ig.Timer(1), loadLevel: function(data) { this.parent(data); this.player = this.getEntitiesByType('EntityPlayer')[0]; if (this.storage.get(playerPos)) this.player.pos = ig.copy(playerPos); }, update: function() { this.parent(); if (this.positionSnapshotTimer.delta() > 0) { this.storage.set('playerPos', this.player.pos); this.positionSnapshotTimer.reset(); } ... }