Forum Topic: Saving exact _x and _y positions?

(132 views • 2 replies)

This topic is 1 page long.

<< < > >>
Crying

RadMad

Reply To Post Reply & Quote

Posted at: 8/30/08 11:56 PM

RadMad DARK LEVEL 08

Sign-Up: 08/26/08

Posts: 70

Ok, so i've been working on a platformer for some time now and i have decided that dying on a level may be a little difficult, so i've decided to make my own little save button, and i was wondering if there was any way to save my exact x and y position on the level or if i can only save the details of my progress (score, and level, etc..)

This is in AS2 and here is my script, (thanks to the help of AS: Main =3

 on (release){
  savefile.data.health=_root.health;
  savefile.data.egg=_root.egg;
  savefile.flush();
}

egg is how many easter eggs you have collected if you were wondering.

BBS Signature

None

corruptedtodeath

Reply To Post Reply & Quote

Posted at: 8/31/08 12:02 AM

corruptedtodeath DARK LEVEL 04

Sign-Up: 08/30/07

Posts: 119

At 8/30/08 11:56 PM, RadMad wrote: Ok, so i've been working on a platformer for some time now and i have decided that dying on a level may be a little difficult, so i've decided to make my own little save button, and i was wondering if there was any way to save my exact x and y position on the level or if i can only save the details of my progress (score, and level, etc..)

This is in AS2 and here is my script, (thanks to the help of AS: Main =3

on (release){
savefile.data.health=_root.health;
savefile.data.egg=_root.egg;
savefile.flush();
}

egg is how many easter eggs you have collected if you were wondering.

if you used AS:Main you should;d already be able to do it...... and all you do use api there is a tutorial in AS:Main (to lazzy to look for it although it should be in basic or intermediate)

and what is the flush(); command for??

ever wanted to know how to earn money or get free games and gaming consoles visit my site to learn more.www.learntoearnmoney.webs.com


None

DrJam

Reply To Post Reply & Quote

Posted at: 8/31/08 12:37 AM

DrJam DARK LEVEL 41

Sign-Up: 12/20/04

Posts: 37

If you're save button works fine for health, all you need to add to that button code is:

savefile.data.playerX = _root.playerName._x
savefile.data.playerY = _root. playerName._y

Don't forget to change "playerName" to whatever you called your player. If you understand the code you have, it should be pretty simple to change it for loading the player position.

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 11:43 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!