Chitti app logo

Chitti is better in the app

Coins, streaks and builds — free on Android & iOS

Get the app
Chitti logoChitti

Programming Part - 2 (sp)

5 Minutes · Module 7 - Struggling Path

ScratchJr game programming for kids: learn to reset characters on animal contact and switch levels using touch blocks. A Tamil coding lesson.

  • Using touch trigger and go home blocks to reset Tom and Ben
  • Repositioning the frog and snake obstacles to make crossing easier
  • Adding page two and coding the bush to transition to the next level
What this lesson teachesRead the lesson as text

In ScratchJr, collision programming uses touch trigger blocks to make characters respond when they bump into obstacles or interactive objects. This system allows games to reset a player back to the start after touching an enemy or transition to a new page when reaching a goal.

Resetting characters after an obstacle hit

In a game, getting caught by an obstacle usually means the player is out and must restart from the beginning. In ScratchJr, this is programmed by selecting a character and opening the trigger block category. The touch trigger block, which displays two figures bumping into each other, detects when a character touches an animal obstacle. Connecting this trigger to the go home block from the motion category returns the character back to its original starting point, and placing an end block completes the sequence.

Copying code between characters

When multiple characters share the exact same behavior, their code does not need to be rebuilt from scratch. A completed script can simply be dragged from one character and dropped directly onto another character's icon. Opening the second character reveals the duplicated blocks ready to run. This saves time and ensures that both characters reset to their home positions identically upon touching any obstacle.

Balancing obstacle positions

Testing a project in full screen reveals whether a level is too difficult or impossible to cross. If animals like snakes and frogs continuously collide with the characters, the player cannot move forward. Leaving full screen mode to enter the programming area allows the creator to move obstacle positions around the screen. Adjusting where each animal sits creates clear paths for characters to walk through successfully.

Switching levels using page gateways

Once players cross an area, the game can move them forward by switching to a new level. Adding a second page creates the space for this next stage, while an object on the first page, such as a bush, acts as the gateway. Selecting the bush and adding a touch trigger block makes it detect when a character walks into it. Attaching an end block labeled with the number two tells the project to switch immediately to page two upon contact.

Part of the course

Scratch Junior

View course →

More in Module 7 - Struggling Path

  1. 1Programming Part - 1 (SP)11 Minutes
  2. 2Programming Part - 2 (sp)Now playing