From Test-Scratch-Wiki

Move () Steps
2.0 Move () Steps.png
Category Motion
Type Stack
Introduced in 1.0
Assuming the black grid shows individual pixel positions, using a move 1 step gets the Scratch cat to the red circle, its final position along the circle depending on its direction. Moving 2 steps gets to orange, and moving 3 steps gets to green.

The Move () Steps block यह एक Motion block और Stack block है. यह ब्लॉक स्प्राइट को बताये गए स्टेप्स आगे की ओर ले जाता है. यह उस दिशा में गती करता है जिस दिशा में उसका मुंह है. एक स्टेप याने एक पिक्सेल जितना अंतर. यह ब्लॉक ट्रिग्ननोमेट्री Trigonometryका प्रयोग सही दिशा में आगे बढ़ने के लिए करता है.

उदहारण

जटिल स्क्रिप्ट्स scriptजैसे Change X by () ब्लॉक्स और Change Y by () ब्लॉक के बजाय , इस ब्लॉक का इस्तेमाल स्प्राइट को नाक की सीध में आगे बढ़ाने के लिए किया जा सकता है.

Move () Steps ब्लॉक के कुछ उदहारण :
  • स्प्राइट को चलाने के लिए

Template:Beginner's Script

repeat (10)
 move (10) steps
end
  • स्प्राइट को माउस पॉइंटर के साथ चलाने के लिए
forever
 point towards [mouse-pointer v]
 move (10) steps
end

वैकल्पिक हल

Main article: List of Block Workarounds

इस ब्लॉक का काम नीचे दिए गए कोड के इस्तेमाल से भी किया जा सकता है:

go to x: ((x position) + (([sin v] of (direction)) * (number))) y: ((y position) + (([cos v] of (direction)) * (number))

यह भी देखें

Cookies help us deliver our services. By using our services, you agree to our use of cookies.