Hi everyone !
I started using Scratch recently and have a problem understanding how coordinates works for an object placed on the scene.
I have this bird I want to move from left to right, then right to left and so on.
The coordinates of my bird on the screen don't fit those displayed in the mouse's coordinates zone... how does it works ?
Thanks in advance !
Offline
The way it works is that each sprite has a set center and you're seeing its coordinates. Your mouse also has a center and it has to be directly over the sprite's center or else the coordinates will differ.
Anyway, I hope that this answers your question!
Offline
I don't understand your problem completely but then again I'm tired. Sorry if this just confuses you more then anything.
Ok the scratch programing thing is made out of a x and y grid. X is the horizontal lines of the grid, going from left to right. A positive x value in a movement block makes the sprite go right, while a negative one makes it go left. The y is the vertical line, up or down. A positive y makes the sprite go up, while a negative goes down. To find the cooords if a object you double click on it then look up in the upper-left hand corner of the screen.
Offline
Thanks a lot Ernie and GenChico ! This indeed answers my question( which I confess was a bit hard to to understand ^^')
So, if I want my bird to start in the left end on the screen and travel to the right end, i'll use something like below but value is to be put instead of 10000 in my example ?
when gf clicked forever repeat until <(x position) = [10000]> move [1] step end end
Offline
Mik_Ael wrote:
Thanks a lot Ernie and GenChico ! This indeed answers my question( which I confess was a bit hard to to understand ^^')
So, if I want my bird to start in the left end on the screen and travel to the right end, i'll use something like below but value is to be put instead of 10000 in my example ?when gf clicked forever repeat until <(x position) = [10000]> move [1] steps end
Fixed. Anway, what you might want to do is first, create a script like this:
when gf clicked forever change x by (1)And once you've run that (which you can do by clicking it), use the sprite's x position instead of 100,000.
Last edited by ErnieParke (2012-11-17 16:48:36)
Offline
Step 1: Drag your bird to wherever you want it to be on the left
Step 2: Check your bird's co-ordinates as shown below
This is where you find the co-ordinates
Remember these co-ordinates or write them down
I will be referring to them as the left co-ordinates
Step 3: Drag your bird to wherever you want it to be on the right
Step 4: Check your bird's co-ordinates as shown below
This is where you find the co-ordinates
Remember these co-ordinates or write them down
I will be referring to them as the right co-ordinates
Step 5: Drag your bird to wherever you want it's starting point to be
Step 6: Check your bird's co-ordinates as shown below
This is where you find the co-ordinates
Remember these co-ordinates or write them down
I will be referring to them as the start co-ordinates
Step 7: Add this script
when gf clicked go to x: (start co-ordinate x) y: (start co-ordinate y) forever point in direction (-90 v) glide (1) secs to x: (left co-ordinate x) y: (left co-ordinate y) point in direction (90 v) glide (1) secs to x: (right co-ordinate x) y: (right co-ordinate y) endJust replace the variable blocks with you start co-ordinates, left co-ordinates and right co-ordinates
Last edited by Bailz_Gamer (2012-11-17 16:53:17)
Offline
Thanks again Ernie, I think I understand the coordinates stuff better now !
Wow, thanks for making me a tutorial so quickly Bailz_Gamer I'm trying it right now to see what method suits the bird best. You sure helped me here!!
I wanna help like that when I grow a little more used to Scratch
Offline
Mik_Ael wrote:
Thanks again Ernie, I think I understand the coordinates stuff better now !
Wow, thanks for making me a tutorial so quickly Bailz_Gamer I'm trying it right now to see what method suits the bird best. You sure helped me here!!
I wanna help like that when I grow a little more used to Scratch
No problem, happy to help
Offline
Mik_Ael wrote:
Thanks again Ernie, I think I understand the coordinates stuff better now !
Wow, thanks for making me a tutorial so quickly Bailz_Gamer I'm trying it right now to see what method suits the bird best. You sure helped me here!!
I wanna help like that when I grow a little more used to Scratch
Your welcome! And certainly, in the near future, you could be helping lots of scratchers.
Offline
OH YEAH I FORGOT
For smooth turning around costumes, click on the left/right arrow in this picture
Offline