Programming Part - 1 (SP)
11 Minutes · Module 7 - Struggling Path
ScratchJr game programming for kids: learn to move characters with touch arrows and loop animal motions in a spooky forest. A Tamil coding lesson.
- Using touch and message blocks to move Tom and Ben with arrows
- Dragging code blocks from Tom to Ben to duplicate movement
- Setting up repeat loops to animate forest animals continuously
What this lesson teachesRead the lesson as text
ScratchJr allows creators to control character movements using on-screen button triggers and broadcast messages, while background characters can animate continuously using repeat loops. Programmers can build interactive games by connecting touch inputs, message blocks, and looping motions.
Triggering movement with touch and messages
Instead of starting an action with the standard green flag, interactive controls use the touch block found in the trigger category. Tapping the red arrow sprite runs a touch block that sends out a color-matched red broadcast message. When Tom and Ben receive this red message through their own trigger blocks, they activate a motion block set to move left. The green arrow is programmed the same way, sending a green message that directs both characters to move right across the screen.
Duplicating code blocks across sprites
Recreating identical block sequences for multiple characters is unnecessary when they share the exact same movement. In ScratchJr, a completed block set can be dragged from one character and dropped directly onto another character icon. Dragging the movement scripts from Tom and dropping them onto Ben instantly copies the receive blocks, motion commands, and end blocks so that Ben moves together with Tom through the forest.
Animating forest animals with repeat loops
- The elephant moves right two steps and left two steps inside a repeat loop block instead of stopping with a standard end block.
- The bat and dragon repeat up and down movements of two steps each inside loop blocks to simulate flying continuously.
- The frog uses a jump block set to one step and repeats its hopping motion continuously using a loop block.
- The snake moves continuously along a four-direction path by repeating right, up, left, and down motion blocks inside a loop.
Testing the game in full-screen mode
Switching the project into full-screen mode allows the player to test character controls directly on the stage. Pressing the green flag starts all animal loop movements, creating active obstacles across the spooky forest. The player guides Tom and Ben past these animals by tapping the on-screen red and green arrow buttons. Pressing the stop button located above the stage halts all running scripts immediately.
Part of the course
Scratch Junior
More in Module 7 - Struggling Path
- 1Programming Part - 1 (SP)Now playing
- 2Programming Part - 2 (sp)5 Minutes