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

#1 2012-12-23 10:32:55

finlayvscott
New Scratcher
Registered: 2012-12-05
Posts: 14

Xposition/yposition

here's my game: http://scratch.mit.edu/projects/finlayvscott/2999566

The problem is, how can I get it to update the xposition/yposition variables as it moves, because it mucks up the shooting. Please help!

Offline

 

#2 2012-12-23 11:22:39

mmww
Scratcher
Registered: 2010-01-14
Posts: 500+

Re: Xposition/yposition

when gf clicked
forever
set [xPosition v] to x position of [sprite 1 v]
set [yPosition v] to y position of [sprite 1 v]
end
I hope i understood you right. I wasn't quite sure what you needed

Last edited by mmww (2012-12-23 11:23:17)


http://i.imgur.com/AWFFO.pnghttp://www.weebly.com/uploads/1/0/1/4/10146167/4363061_orig.png Save the cheese!
I am http://blocks.scratchr.org/API.php?action=onlineStatus&user=mmww

Offline

 

#3 2012-12-23 11:24:44

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Xposition/yposition

Well, you could just put in a new script for the guy, like:

when gf clicked
forever
set [xposition v] to (xposition)
set [yposition v] to (yposition)
Is that what you need? Hope it helps!


http://i48.tinypic.com/2072ctw.gif

Offline

 

#4 2012-12-23 11:26:02

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Xposition/yposition

mmww wrote:

when gf clicked
forever
set [xPosition v] to ([x position v] of [sprite 1 v])
set [yPosition v] to ([y position v] of [sprite 1 v])
end
I hope i understood you right. I wasn't quite sure what you needed

I think it's just the coordinates of the sprite itself.


http://i48.tinypic.com/2072ctw.gif

Offline

 

#5 2012-12-23 11:37:04

mmww
Scratcher
Registered: 2010-01-14
Posts: 500+

Re: Xposition/yposition

powerpoint56 wrote:

mmww wrote:

when gf clicked
forever
set [xPosition v] to ([x position v] of [sprite 1 v])
set [yPosition v] to ([y position v] of [sprite 1 v])
end
I hope i understood you right. I wasn't quite sure what you needed

I think it's just the coordinates of the sprite itself.

Yes, but it depends on what sprite you put the script in. This would work for all sprites


http://i.imgur.com/AWFFO.pnghttp://www.weebly.com/uploads/1/0/1/4/10146167/4363061_orig.png Save the cheese!
I am http://blocks.scratchr.org/API.php?action=onlineStatus&user=mmww

Offline

 

#6 2012-12-23 11:37:31

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Xposition/yposition

mmww wrote:

powerpoint56 wrote:

mmww wrote:

when gf clicked
forever
set [xPosition v] to ([x position v] of [sprite 1 v])
set [yPosition v] to ([y position v] of [sprite 1 v])
end
I hope i understood you right. I wasn't quite sure what you needed

I think it's just the coordinates of the sprite itself.

Yes, but it depends on what sprite you put the script in. This would work for all sprites

Yes.


http://i48.tinypic.com/2072ctw.gif

Offline

 

Board footer