Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Scratch/Block Reference Guide

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

+Table of BlocksBlock pictureNameDescriptionCategoryExamples149x149pxmove () stepsMoves a sprite forward a specified amount of "steps" in the direction it is facing.Motionmove (5) steps move (7) steps move (2) steps186x186pxturn right () degreesRotates the sprite clockwise a set amount of degrees.Motionturn right (20) degrees turn right (3) degrees turn right (7) degrees186x186pxturn left () degreesRotates the sprite counterclockwise a set amount of degrees.Motionturn left (30) degrees turn left (12) degrees turn left (36) degrees200x200pxgo to ()Moves the sprite to the selected location. The location can be a random position, the mouse-pointer, or any sprite.Motiongo to (mouse-pointer) go to (Ground) go to (Arrow)188x188pxgo to x: () y: ()Jumps the sprite to the specified x and y coordinates.Motiongo to x: (30) y: (50) go to x: (0) y: (0) go to x: (100) y: (48)300x300pxglide () secs to ()Glides the sprite to the specified position in the specified amount of time. The location can be a random position, the mouse-pointer, or any sprite.Motionglide (2) secs to (mouse-pointer) glide (0.5) secs to (Grass) glide (5) secs to (random position)267x267pxglide () secs to x: () y: ()Glides the sprite to the specified x and y coordinates in the specified amount of time. Motionglide (2) secs to x: (-29) y: (23) glide (10) secs to x: (9) y: (9) glide (0.5) secs to x: (16) y: (-100)180x180pxpoint in direction ()Points the sprite in the specified direction.Motionpoint in direction (180) point in direction (67) point in direction (-90)256x256pxpoint towards ()Points the sprite towards the selected location. The location can be the mouse-pointer or any sprite.Motionpoint towards (cloud) point towards (title text) point towards (mouse-pointer)160x160pxchange x by ()Changes the sprite's x coordinate by the specified amount. A positive change will move the sprite to the right while a negative change will move the sprite to the left.Motionchange x by (-30) change x by (60) change x by (32)121x121pxset x to ()Sets the sprite's x coordinate to the specified value.Motionset x to (180) set x to (-90) set x to (100)160x160pxchange y by ()Changes the sprite's y coordinate by the specified amount. A positive change will move the sprite up while a negative change will move the sprite down.Motionchange y by (20) change y by (-100) change y by (25)139x139pxset y to ()Sets the sprite's y coordinate to the specified value.Motionset y to (34) set y to (-68) set y to (122)165x165pxif on edge, bounceChecks if the sprite is on the edge of the stage. If it is, the sprite is "bounced" back into the stage to prevent it from going off the screen. If left-right rotation is enabled (see below block), the sprite will flip around to the other direction when it bounces. If all around rotation is enabled, the sprite will flip upside down and flip to the other direction when it bounces.Motionforever { if on edge, bounce } if (x position < -200) { if on edge, bounce }245x245pxset rotation style []Changes the rotation style of the sprite. The style can be left-right (the sprite can only face the left or right), don't rotate (the sprite is not able to rotate), or all around (the sprite can rotate to any direction).Motionforever { set rotation style [all around] }187x187px() mod ()Returns the remainder (modulo) after the first number is divided by the second.Operators(16) mod (7) = 2 (75) mod (34) = 69 (7) mod (2) = 1 (7) mod (3.3) = 0.3 (1) mod (0.3) = 0.1329x329pxadd () to []Adds the specified item to the specified list.Variables (Lists)add ("grapes") to [fruits] If 'fruits' was the list: apples cherries then 'fruits' would then be apples cherries grapes add ("16") to [squares] If 'squares' was the list: 1 4 9 then 'squares' would then be 1 4 9 16203x203pxdelete () of []Removes the specified item from the specified list.Variables (Lists)delete (4) from [players] If 'players' was the list: 1 4 8 10 then 'players' would then be 1 4 8 delete (3) of [words] If 'words' was the list: hide jump run seek then 'words' would then be hide jump seek