This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-12-06 09:50:52

tharvoil
Scratcher
Registered: 2008-10-24
Posts: 24

Resturn to last Position

Am I crazy or did there not used to be a block for this? I could swear I remember seeing a block for this at some point yet now when I look can't find one for the life of me, if I'm just imagining it, could soem1 post a code that does the same thing?

Thanks

Offline

 

#2 2008-12-06 10:37:11

dsdude10
Scratcher
Registered: 2007-09-22
Posts: 500+

Re: Resturn to last Position

just make two variables:
old X
old Y
and then before you move to a new position, do this:
set old X to (X position)
set old Y to (Y position)
and then when you want to return to your old position, do this:
go to x: (old X) y: (old Y)

Offline

 

#3 2008-12-06 11:04:46

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Resturn to last Position

or use lists. record every x and y position when it moves and when you want to go back, just go set X to last of (list) old X, delet last of old X

Offline

 

#4 2008-12-06 11:11:29

dsdude10
Scratcher
Registered: 2007-09-22
Posts: 500+

Re: Resturn to last Position

here's an example of using the variables tharvoil: http://scratch.mit.edu/projects/dsdude10labs/343135

Offline

 

#5 2008-12-06 11:21:17

tharvoil
Scratcher
Registered: 2008-10-24
Posts: 24

Re: Resturn to last Position

thanks, guess i was just imaging the return to last position block but stil bugs me..... we definatly need one

Offline

 

Board footer