# Saving coordinates

**URL:** <https://forum.kirupa.com/t/saving-coordinates/174840>\
**Category:** Uncategorized\
**Created:** [January 9, 2006, 7:17pm UTC](https://forum.kirupa.com/t/saving-coordinates/174840 "2006-01-09T19:17:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)\
**Post date:** [January 9, 2006, 7:17pm UTC](https://forum.kirupa.com/t/saving-coordinates/174840/1 "2006-01-09T19:17:00Z")

</div>

Thanks to a lot of help from kirupa, I’m almost done with a small rpg game. I’m left with the last step of the battle phase - returning the hero back to where he was in the world map.

I’ve never actually found out how, but I’m assuming it’s

onEnterFrame();  
this.\_x = (saved coordinates x)  
this.\_y = (saved coordinates y)

I believe there should also be a dynamic box that keeps of a record where the hero was last IE

(saved coordinates x) = \_x  
(saved coordinates y) = \_y

Currently my game is setup like this:  
This is not a[COLOR=Red] tile based game, [/COLOR]it is all movement generated by a speed factor and a up down left right combo.

first frame is the loader.  
second frame is the world map.  
third being the battle frame.

The hero wanders off, and after a few steps he finds a battle (which beautifully transitions to the battle screen), after he is victorious, he is sent back to the world map, but unfortunately, he is sent back where he first started…

I tried a few tutorials, but they were all never finished to the battle part, which I need at the moment.

any help will be appreciated.

-thanks
