yes... I know to some multi-lingual programers ( I mean you know many programming languages!) this is basic stuff, but others may find this interesting. I am going to show you how the move() steps block works.
Basically to move right:
When key right arrow pressed:
Change x by (sin of direction)
Change y be (cos of direction)
When key left arrow pressed:
Change x by ((sin of direction) * -1)
Change x by ((cos of direction) * -1)
When key up arrow pressed:
Change x by (cos of direction)
Change y be (sin of direction)
When key down arrow pressed:
Change x by ((cos of direction) * -1)
Change x by ((sin of direction) * -1)
Hope you learnt something new!
Offline
I think what you are trying to show here, is how Scratch computes (behind the scenes, as it were) the new X and Y coordinates after a Move command. Scratch is using trigonometry to turn the motion in a given direction into new X and Y coordinates. This might be helpful for folks who are trying to get a handle on how Trig functions work.
I think you have an error though, all of the Cos and Sin functions should be multiplied by the number of steps that the sprite is moving in the given direction, for example:
Change x by Steps * (sin of direction)
Offline