ICSOC-8.11.2 Motion and Looks Programming Blocks (M)

Easy

ICSOC-8.11.2.1 Kinematics in Scratch: Absolute Positioning vs. Relative Vector Translation

Kinematics in Scratch: Absolute Positioning vs. Relative Vector Translation

In the Scratch execution framework, sprite translation across the 2D Cartesian plane is governed by two fundamentally distinct spatial paradigms: absolute positioning and relative vector movement. Absolute positioning instructions—principally the ‘go to x: ( ) y: ( )’ and timed interpolation ‘glide ( ) secs to x: ( ) y: ( )’ blocks—relocate a sprite directly to predetermined, fixed coordinates on the stage regardless of its current position or directional orientation. In contrast to instantaneous coordinate teleportation, the ‘glide’ block calculates smooth linear interpolation over designated execution frames, temporarily yielding execution thread control until the destination vector is reached. Additionally, absolute targeting encompasses the ‘go to [mouse-pointer / random position / sprite]’ command, which queries real-time hardware or object coordinates at execution runtime.

Conversely, relative movement relies intrinsically upon the sprite’s current spatial state, notably its active directional angle and existing coordinates. The fundamental ‘move ( ) steps’ block translates the sprite forward or backward along its currently facing heading vector using trigonometric displacement (delta x = steps * sin(theta) and delta y = steps * cos(theta), aligning with Scratch’s 0-degree North orientation). Complementing vector stepping, direct relative coordinate modifications via ‘change x by ( )’ and ‘change y by ( )’ bypass sprite orientation entirely, shifting position parallel to the primary axes. Mastering the operational divergence between absolute coordinate mapping and orientation-dependent stepping is essential for programming deterministic physics engines, responsive platformer controls, and synchronized algorithmic animations.

Easy
What is the primary operational difference between the [go to x: ( ) y: ( )] block and the [move ( ) steps] block in Scratch 3.0?
Option A is correct because [go to x: y:] is an absolute positioning command that directly overwrites the sprite’s X and Y coordinates with specified stage coordinates regardless of where the sprite is facing. In contrast, [move steps] performs relative vector translation along the sprite’s current heading angle (direction). Option B is incorrect because [go to x: y:] accepts negative coordinates and functions across all four quadrants (-240 to +240 for X, -180 to +180 for Y). Option C is incorrect because [go to x: y:] executes instantaneously in a single frame; smooth animated transitions over time are performed by the [glide () secs to x: y:] block. Option D is incorrect because neither block alters costume size; size is modified exclusively through Looks blocks.
Medium
A sprite is currently placed at coordinates (x: 50, y: -20) with its direction set to 90° (facing East/Right). Which sequence of blocks will relocate the sprite to the exact same position as executing [change x by -30]?
Option B is correct because the initial position is (50, -20). Executing [change x by -30] adds -30 to the current X-coordinate while leaving Y unchanged: new x = 50 + (-30) = 20, and y = -20. Thus, executing the absolute positioning block [go to x: 20 y: -20] places the sprite at the exact identical location (20, -20) without modifying its direction. Option A is incorrect because although moving 30 steps facing -90° reaches x: 20, it mutates the sprite’s direction from 90° to -90°, altering sprite state. Option C is incorrect because it moves the sprite to (-30, -20), which subtracts 80 from X rather than 30. Option D is incorrect because facing direction 180° points downward (South), which would alter the Y-coordinate to -50.
Tricky
Consider a script where a sprite at (x: 0, y: 0) runs: [glide 2 secs to x: 100 y: 100] followed immediately by [say “Arrived!”]. In another concurrent script triggered by the same Green Flag, a developer runs: [repeat 20] -> [change size by 5] -> [wait 0.1 secs]. How does the Scratch execution engine handle the [glide] block relative to these scripts?
Option B is correct because Scratch utilizes an event-driven, cooperative multi-threading runtime. The [glide () secs to x: y:] block is a synchronous blocking instruction for its containing script stack—meaning it yields control between frames and will not advance to [say “Arrived!”] until the full 2 seconds elapse—while concurrently allowing other independent script stacks (such as the size-changing loop) to execute in parallel each frame. Option A is incorrect because Scratch does not freeze the entire project; concurrency across independent hat block stacks is fully preserved. Option C is incorrect because [glide] interpolates position incrementally across display refresh ticks rather than teleporting. Option D is incorrect because [say “Arrived!”] is blocked until the destination interpolation completes.
Medium

ICSOC-8.11.2.2 Angular Kinematics: Polar Heading Angles, Angular Displacement, and Object Orientation

Angular Kinematics: Polar Heading Angles, Angular Displacement, and Object Orientation

Sprite orientation in Scratch operates under a specialized polar coordinate convention that diverges from traditional mathematical trigonometry. Rather than measuring counter-clockwise from the positive horizontal axis, Scratch defines directional headings along a 360-degree circular compass dial where 0° denotes North (straight Up), 90° represents East (straight Right, the default spawning orientation), 180° indicates South (straight Down), and -90° (or 270°) corresponds to West (straight Left). Angular orientation can be established absolutely using the ‘point in direction ( )’ block, which accepts both positive and negative integer degree values or dynamic reporter variables, immediately locking the sprite’s trajectory to an exact polar angle.

To facilitate continuous rotation and angular trajectory adjustments, Scratch provides relative rotation blocks: ‘turn clockwise ( ) degrees’ and ‘turn counterclockwise ( ) degrees’. These blocks apply incremental angular displacement (new_angle = current_angle +/- delta_angle), automatically normalizing the internal angle representation within the modular range (-179° to +180° or 0° to 359°). Furthermore, contextual targeting is enabled by the ‘point towards [mouse-pointer / sprite]’ block, which dynamically calculates the arctangent angle between the sprite’s costume center and the instantaneous target coordinates. Understanding how angular orientation interacts with forward velocity in ‘move steps’ is the foundation of robotic simulation, orbital path generation, and directional projectile targeting.

Easy
In the Scratch 3.0 directional compass system, which numerical value represents pointing straight Up (North)?
Option A is correct because Scratch defines its polar directional convention with 0° pointing straight Up (North), 90° pointing to the Right (East, standard default), 180° pointing straight Down (South), and -90° (or 270°) pointing to the Left (West). Option B is incorrect because 90° represents pointing Right (East). Option C is incorrect because 180° represents pointing Down (South). Option D is incorrect because -90° represents pointing Left (West).
Medium
A sprite is initialized with [point in direction 45]. A script then executes [repeat 6] containing [turn clockwise 60 degrees]. What is the sprite’s final internal direction value after the loop completes?
Option A is correct because the loop executes 6 iterations of turning clockwise 60°, resulting in a total angular displacement of 6 * 60° = 360°. Adding 360° to the initial orientation of 45° results in 405°. Because Scratch normalizes circular angles within the standard -179° to +180° range (or modular 360° circle), rotating a complete 360° brings the sprite back to its exact original heading: 405° – 360° = 45°. Option B is incorrect because 105° corresponds to a 60° single turn offset. Option C is incorrect because 360° corresponds to 0° (North), not 45°. Option D is incorrect because Scratch normalizes angle representations rather than maintaining unbound accumulators exceeding 360°.
Tricky
A sprite is positioned at the Stage origin (x: 0, y: 0) facing direction 0° (North). The mouse pointer is currently hovering at coordinates (x: -50, y: 50). If the script executes [point towards [mouse-pointer]], what direction value will Scratch assign to the sprite?
Option A is correct because the sprite is at (0, 0) and the mouse pointer is located at (-50, 50), which lies in Quadrant II of the Cartesian plane (negative X, positive Y). In Scratch’s coordinate system, 0° is straight Up (+Y) and -90° is straight Left (-X). The line connecting (0, 0) to (-50, 50) forms an angle bisecting Up and Left, which corresponds exactly to -45° (or 315° in positive polar coordinates). Option B is incorrect because +45° points Up and Right (+X, +Y, Quadrant I). Option C is incorrect because +135° points Down and Right (+X, -Y, Quadrant IV). Option D is incorrect because -135° points Down and Left (-X, -Y, Quadrant III).
Tricky

ICSOC-8.11.2.3 Boundary Reflection Physics: Edge Collision Detection and Rotation Style Constraints

Boundary Reflection Physics: Edge Collision Detection and Rotation Style Constraints

Maintaining autonomous entity containment within the 480×360 pixel stage boundary is a critical requirement in graphical game design. The specialized Motion block ‘if on edge, bounce’ automates collision detection against the four perimeter margins (x = +/-240, y = +/-180). When a sprite’s collision bounding box intercepts a stage boundary, the engine computes an optical specular reflection of the sprite’s motion vector. For vertical boundaries (left and right edges), the horizontal vector component is inverted while vertical velocity is preserved, reflecting the heading across the vertical axis (direction_new = -direction_old). For horizontal boundaries (top and bottom edges), the vertical vector component is inverted (direction_new = 180 – direction_old), perfectly modeling elastic kinematic bounce behavior.

However, unconstrained specular reflection often produces undesirable visual artifacts, such as characters rendering upside down when rebounding from walls. To regulate visual rendering independently of mathematical trajectory, Scratch implements three distinct Rotation Styles via the ‘set rotation style [all around | left-right | don’t rotate]’ block. The default ‘all around’ style permits full 360-degree costume rotation matching the direction angle. The ‘left-right’ style restricts costume rendering to horizontal bilateral flipping: when the direction vector points between 1° and 179°, the costume faces right, whereas pointing between -1° and -179° mirrors the costume horizontally across its vertical axis without vertical inversion. Lastly, ‘don’t rotate’ locks the visual costume entirely in its initial orientation while internal coordinate vectors continue calculating complex trajectories under the hood.

Easy
Which Rotation Style in Scratch prevents a sprite from ever turning upside down, only permitting it to face left or right?
Option B is correct because the ‘left-right’ rotation style restricts visual costume rendering to horizontal bilateral flipping along the vertical axis without tilting or flipping upside down. When heading towards positive X (1° to 179°), the costume faces right; when heading towards negative X (-1° to -179°), it mirrors horizontally. Option A is incorrect because ‘all around’ permits 360-degree rotation, causing sprites to appear upside down when moving downwards or reflecting off edges. Option C is incorrect because ‘don’t rotate’ locks the costume in a single fixed direction and will not even flip horizontally. Option D is incorrect because ‘free rotate’ is not a valid Scratch rotation style.
Medium
A sprite is moving across the stage with its direction set to 30°. It collides with the right edge (x = 240) of the stage and executes the block [if on edge, bounce]. What is the sprite’s new direction after the bounce?
Option A is correct because when a sprite impacts a vertical boundary (the right or left edge), the physics engine in Scratch inverts the horizontal component of the velocity vector while maintaining the vertical component. Mathematically, reflecting across the vertical axis negates the direction angle: new_direction = -old_direction = -30°. Option B is incorrect because 150° represents reflection off a horizontal boundary (top or bottom edge, where new_direction = 180° – 30° = 150°). Option C is incorrect because -150° represents a total reversal of both horizontal and vertical components (a 180° turn). Option D is incorrect because 210° is equivalent to -150°.
Tricky
A developer sets a sprite’s rotation style to [don’t rotate] and runs a script: [point in direction 180] -> [repeat 10] -> [move 10 steps]. Which statement accurately describes the resulting physical motion and visual appearance of the sprite?
Option B is correct because the rotation style governs ONLY visual costume rendering on the stage, not underlying mathematical kinematics. Pointing in direction 180° directs the motion vector straight Down (negative Y-direction). Executing [repeat 10] with [move 10 steps] translates the sprite downwards by 10 * 10 = 100 pixels (decreasing Y by 100). Because the rotation style is [don’t rotate], the graphic costume remains strictly upright without tilting upside down. Option A is incorrect because disabling visual rotation does not immobilize the sprite’s position. Option C is incorrect because direction 180° is vertical (Down), not horizontal, and [don’t rotate] forbids upside-down flipping. Option D is incorrect because Scratch never throws runtime syntax exceptions for valid block combinations.
Easy

ICSOC-8.11.2.4 Visual Presentation and Communication: Costume Cycling, Thought Bubbles, and Speech Callouts

Visual Presentation and Communication: Costume Cycling, Thought Bubbles, and Speech Callouts

The Looks block category (rendered in violet-purple) governs the visual rendering state, graphic attire, and communicative overlays of sprites and the stage. Frame-by-frame sprite animation relies upon costume iteration controlled via two primary blocks: ‘switch costume to [costume]’ and ‘next costume’. While ‘switch costume to’ establishes a deterministic appearance by accepting a specific costume name or 1-based index (with dynamic variable mapping), ‘next costume’ increments the costume pointer cyclically. Upon reaching the terminal costume in the sprite’s asset array, ‘next costume’ automatically wraps around to the initial costume (i_new = (i mod n) + 1), providing a seamless mechanism for cyclic walk cycles and state-driven animations when coupled with timer delays.

Beyond kinematic animation, Looks blocks provide text-based narrative overlays through speech and thought bubbles. The ‘say [text] for ( ) seconds’ and ‘think [text] for ( ) seconds’ blocks render cartoon callout bubbles anchored to the sprite’s costume bounding box. Crucially, both blocks operate as synchronous, thread-blocking instructions: they halt script execution flow on their specific stack for the designated duration before advancing to the subsequent block. Conversely, the open-ended ‘say [text]’ and ‘think [text]’ blocks are asynchronous and non-blocking; they instantaneously instantiate the overlay bubble and pass control immediately to the next block. An open-ended bubble persists indefinitely until overwritten by another dialogue block or cleared by passing an empty string (‘say []’).

Easy
What occurs when the [next costume] block is executed while a sprite is already displaying its final costume in the Costumes list?
Option B is correct because the [next costume] block implements cyclic modulo indexing. When the current costume index equals the total number of available costumes (n), executing [next costume] cycles back to costume index 1 ((current mod n) + 1). Option A is incorrect because Scratch is designed to be error-resilient and never throws out-of-bounds errors for asset switching. Option C is incorrect because [next costume] never triggers [hide] or alters visibility. Option D is incorrect because [next costume] continuously cycles rather than halting at the terminal index.
Medium
What is the architectural difference between executing [say “Hello!” for 2 seconds] versus [say “Hello!”] in a Scratch script stack?
Option A is correct because [say … for 2 seconds] is a synchronous, blocking block: it displays the speech bubble and pauses the execution flow of its containing script thread for 2 seconds before executing the subsequent block. In contrast, [say …] is asynchronous and non-blocking: it instantiates the speech bubble and immediately passes execution flow to the following block in the same frame. Option B is incorrect because thought bubbles are generated exclusively by [think …] blocks, not [say … for seconds]. Option C is incorrect because both blocks accept arbitrary strings and numbers. Option D is incorrect because neither block affects sprite deletion or visibility.
Tricky
A sprite executes [say “Welcome!”] without a duration parameter. Which of the following actions will successfully remove the speech bubble from the stage?
Option A is correct because an open-ended [say …] block creates a persistent speech bubble that remains visible until overwritten by another dialogue block or explicitly cleared by passing an empty string ([say []] or [think []]). Option B is incorrect because moving the sprite simply moves the attached speech bubble along with it across the stage. Option C is incorrect because switching costumes alters the character’s graphic appearance but preserves active overlay speech bubbles. Option D is incorrect because backdrop switches affect only the stage background and do not clear overlay bubbles on foreground sprites.
Medium

ICSOC-8.11.2.5 Digital Image Processing and Shader Effects: The Seven Graphic Transformation Algorithms

Digital Image Processing and Shader Effects: The Seven Graphic Transformation Algorithms

Scratch incorporates a real-time WebGL shader pipeline that dynamically manipulates sprite and stage textures via seven parametric Graphic Effects: Color, Fisheye, Whirl, Pixelate, Mosaic, Brightness, and Ghost. Manipulated via the ‘change [effect] effect by ( )’ and ‘set [effect] effect to ( )’ blocks, these transformations alter pixel rendering pipelines without permanently editing underlying vector or bitmap assets. The ‘color’ effect shifts the entire hue spectrum cyclically across a 0 to 200 unit scale (wrapping around at 200, matching a 360-degree color wheel). The ‘brightness’ effect adjusts luminance from -100 (absolute pitch black) to +100 (pure saturated white), while the ‘ghost’ effect governs alpha transparency, where 0 represents full opacity and 100 renders the sprite completely invisible—yet computationally active and capable of sensing mouse clicks and collision events.

Geometric distortion shaders alter pixel distribution and spatial rendering across the sprite’s surface. The ‘fisheye’ effect warps textures via spherical lens distortion, bulging the center outward at positive values and pinching inward at negative values. The ‘whirl’ effect applies non-linear rotational twisting around the costume center, spiraling pixels inward. The ‘pixelate’ effect downsamples resolution into chunky mosaic macro-blocks, where higher values produce coarser rasterization. The ‘mosaic’ effect divides the texture into a geometric grid of repeating miniaturized sprite clones (N = (1 + floor(effect / 10))^2). All cumulative shader manipulations can be instantaneously purged from the rendering buffer using the non-blocking ‘clear graphic effects’ block, resetting the entity to its original pristine graphic state.

Easy
Which Graphic Effect in Scratch 3.0 controls the transparency of a sprite, allowing it to become completely see-through when set to 100?
Option A is correct because the ‘Ghost’ effect adjusts the alpha transparency channel of the sprite’s texture. A Ghost value of 0 represents full opacity (completely solid), whereas a Ghost value of 100 renders the sprite 100% transparent (completely see-through). Option B is incorrect because Pixelate downsamples image resolution into blocky pixel clusters. Option C is incorrect because Brightness adjusts luminance between -100 (black) and +100 (white). Option D is incorrect because Whirl applies rotational twisting around the sprite’s costume center.
Medium
A sprite’s color effect is initialized to 0. A script executes [repeat 8] containing [change [color] effect by 25]. What is the visual color state of the sprite at the end of the script?
Option A is correct because the color effect in Scratch cycles through the visible hue spectrum along a 0 to 200 unit scale, where 200 represents a full 360-degree rotation around the color wheel and wraps back to 0. Executing 8 iterations of +25 yields a total increase of 8 * 25 = 200 units. Since 200 wraps completely around the hue scale (200 mod 200 = 0), the sprite’s final color matches its original appearance. Option B is incorrect because grayscale/inversion is not produced by a full color cycle. Options C and D are incorrect because black and white luminance are controlled by the Brightness effect (-100 and +100), not the Color effect.
Tricky
A game developer needs an invisible collision trigger zone on the stage that detects when the player’s character touches it. Why is setting [set [ghost] effect to 100] architecturally superior to using the [hide] block for this trigger?
Option A is correct because when a sprite is hidden via the [hide] block, the Scratch engine completely disables its visual hitbox, meaning sensing blocks like [] or [] will evaluate to FALSE. In contrast, setting the ‘ghost’ effect to 100 renders the sprite 100% visually transparent while preserving its collision hitbox, allowing other sprites to reliably detect collisions with it. Option B is incorrect because [hide] does not deallocate or delete the sprite from memory. Option C is incorrect because graphic shader effects do not bypass the physics engine. Option D is incorrect because [hide] is designed specifically for sprites.
Tricky

ICSOC-8.11.2.6 Visual Stacking Order: Z-Index Depth Sorting and Dynamic Layer Management

Visual Stacking Order: Z-Index Depth Sorting and Dynamic Layer Management

On the two-dimensional Scratch stage, rendering depth and overlapping occlusion are governed by an internal visual stacking list known computationally as the Z-ordering or layer index. Because the Stage background is inherently anchored at the absolute lowest tier of the render hierarchy (beneath all sprites), layer management blocks operate exclusively upon instantiated sprite entities. Scratch maintains all active sprites in a strict, single-file stacking sequence: no two sprites can inhabit the exact same depth index simultaneously. Whenever a user manually clicks or drags a sprite in the interactive development environment, the Scratch runtime automatically elevates that sprite to the very top of the stack, which can unintentionally disrupt programmatic layering unless regulated by explicit code instructions.

Programmatic depth sorting is achieved using two core Looks blocks: ‘go to [front | back] layer’ and ‘go [forward | backward] ( ) layers’. The absolute block ‘go to front layer’ immediately moves the executing sprite to the highest active Z-index (Z_max), ensuring it renders unobstructed above all other stage elements, while ‘go to back layer’ drops it just above the background canvas (Z = 1). Relative stacking adjustments via ‘go forward/backward (n) layers’ shift the sprite’s relative index through the active sprite array. If a project contains k active sprites and a sprite at the bottom executes ‘go forward 100 layers’, Scratch clamps the index to the maximum available depth rather than throwing an overflow error. Mastering layer priority is essential for complex user interface design, parallax multi-plane scrolling, and authentic depth simulation in 2.5D game worlds.

Easy
Which Looks block ensures that a dialogue menu sprite is displayed on top of all other overlapping sprites on the stage?
Option A is correct because the [go to [front] layer] block immediately promotes the executing sprite to the highest Z-index in the visual rendering stack, guaranteeing that it appears in front of all other overlapping sprites. Option B is incorrect because [go to [back] layer] sends the sprite behind all other sprites (just above the stage backdrop). Option C is incorrect because [set layer to 1] does not exist in Scratch 3.0. Option D is incorrect because shifting by 0 layers performs no stacking adjustment.
Medium
A Scratch project contains exactly 4 sprites stacked from front to back: Sprite A (front), Sprite B (2nd), Sprite C (3rd), and Sprite D (back). If Sprite D executes [go forward 2 layers], what is the resulting stacking order from front to back?
Option A is correct because the initial order from back to front is: Layer 1 (back) = Sprite D, Layer 2 = Sprite C, Layer 3 = Sprite B, Layer 4 (front) = Sprite A. Moving Sprite D forward by 1 layer places it above Sprite C (Layer 2). Moving it forward by a 2nd layer places it above Sprite B (Layer 3), directly behind Sprite A (Layer 4). Thus, the new order from front to back is: Sprite A (front), Sprite D (2nd), Sprite B (3rd), and Sprite C (back/4th). Option B is incorrect because Sprite D would need to move forward 3 layers to reach the front. Option C is incorrect because moving forward only 1 layer leaves Sprite D behind Sprite B. Option D is incorrect because Sprite A is never demoted to the back.
Tricky
In a project with 5 sprites, Sprite X is currently at the very bottom layer (back). A script on Sprite X executes [go forward 50 layers]. How does the Scratch 3.0 runtime engine handle this instruction?
Option A is correct because Scratch is architected to prevent project crashes and runtime exceptions. Layer shifting operations internally clamp the calculated index between the valid bounds [1, N], where N is the total count of active sprites. If the requested forward offset exceeds the number of sprites above it, the engine simply places the sprite at the highest available position ([front layer]). Option B is incorrect because Scratch block operations never throw unchecked fatal runtime exceptions. Option C is incorrect because layer indexing does not wrap circularly with modulo arithmetic. Option D is incorrect because number input fields in Scratch accept arbitrary positive or negative numeric values without arbitrary parameter limits.