How to Scratch?

in WORLD OF XPILAR2 months ago (edited)

I was somewhat surprised to see Scratch in the Computing curriculum for my son, who's in grade 1.

For those who don't know, Scratch is a high-level, block-based visual programming language developed by MIT Media Lab. It is intended for kids and anyone who wants to dive into the world of programming from scratch.

I was surprised because I didn't learn programming until I started my bachelor's. It wasn't part of the curriculum in high school; all we were taught were different terminologies and some theoretical stuff. Computers weren't common back then.

Times have changed now; my son has already been using ScratchJr since last year and creates silly animations sometimes. I haven't taught him anything, he uses it as a game and creates with whatever logic comes to his mind.

He requested I create something with him, so we built a short interactive story. I didn't use ScratchJr for our story though, because it's basic and is for non-readers. My son, who can read perfectly fine, I thought to introduce him to Scratch. We used the following link - https://scratch.mit.edu/

👩‍💻 Ideation

What to create? It's the most daunting part for me. It's not that I don't have ideas, it's deciding on one idea that takes all my time. Anyhoo, we didn't think much this time and went with a short space story.

An astronaut goes on MissionX to Mars. While up there, he also sees a black hole. Now it's up to the user to decide where he goes. If he chooses to visit Mars, there he meets an alien. Who further invites him to his home planet. If he chooses to visit a black hole, his rocket falls into nothingness.

This was the basic storyline.

👩‍💻 Graphics

This is my least favourite part. Which backdrop to choose, how the character should look, other props, etc. The whole look and feel is not my cup of tea. Since this activity wasn't going to get graded and was purely intended for fun and learning, we chose almost everything from Scratch's database and didn't put any effort into the designing part.

Scratch provides a two-dimensional environment in which there are Sprites who navigate this world in different backdrops and interact within that space. Sprites are basically characters or objects in simple words.

Main sprites for this story were an astronaut, a rocket, an alien (named Vector), mars, blackhole, and Scratch the cat itself which is the default character or sprite.

Then we had to choose backdrops for the story to make it more interactive and engaging. Rocket Station, Space, Mars Surface, Inside of a Black Hole, Alien Planet.

👩‍💻 Programming

In the first scene, the astronaut walks towards the rocket and boards it.

Instructions for Astronaut Sprite
Rocket Station Backdrop

I wrote these instructions myself because my son didn't know how to move an object to a specific point. He had been moving things randomly in Scratch Jr. I briefly explained to him about the cartesian plane, to which he replied I already know. I don't know how, but yeah, he's an over-confident know-it-all kid.

When the astronaut had to make a choice between Mars and Blackhole, I taught him about conditionals. Here, I also defined a function go_to, which took the response of the user (string) as an argument. That was just for me to check how it works in Scratch. He wouldn't understand the purpose of a function yet.

Instructions for Rocket (Sprite)
Stars/Space Backdrop

Note: These instructions are for Rocket, not for the Astronaut because he is inside the rocket.

There's a scene on the alien's planet (Gelato) where the astronaut and alien dance happily to see so many gelatos. I defined another function dance here to define the dance moves. Through this function, I taught my son the use of loops. I devised a simple move of tilting between 105 degrees and 75 degrees and repeated it 3 times. The sprite was originally at 90 degrees. First, it was moved to 75 degrees by subtracting 15 degrees, and then from there, I just added and subtracted 30 degrees again and again. When it was done dancing, I switched it back to 90 degrees one last time by moving another 15 degrees.

Dance Function
Backdrop of Gelato Planet

I know the characters are hardly visible in this noisy backdrop that I created with AI. I wasn't interested in designing something cool.

I don't know how much of it my son understood. After spending some time on it with me, he switched to the idea phase and kept giving me more suggestions about how the story should proceed instead of listening to the implementation part. Anyhoo, he's young for that and I wanted to develop his interest, not burden him with programming jargon. I wanted to show him what can be achieved through some set of instructions.

Here's the link to this scratch project, I invite you to run it and see our silly short story. If you are interested in the implementation part, you can see it too in the left panel.

I wrote very basic instructions and skipped exception handling at all. I might develop the storyline or just improve the code in the future when I have more time for this. It was intended for fun. I would like to keep it to that for now.

Note: Open the project link on desktop browser or in the mobile app. It doesn't work properly on mobile's browser.

Fun Fact: My kids enjoyed doing the voice-over for the alien and the astronaut.

Sort:  
 2 months ago 

It's not that I don't have ideas, it's deciding on one idea that takes all my time.

Aha! Yes! I feel you.

@event-horizon, this article is now being scheduled for featuring on our WOX channel on Telegram, https://t.me/woxchannel.

Everyone is also invited to join ChatSteemBot on Telegram through this link: https://t.me/SteemBot or scan the QR Code on the flyer below. Thanks.

v3.png
World of Xpilar Telegram Channel | Chat SteemBot on Telegram

Everyone can support this initiative by delegating some SP to @sbsupport. Thanks in advance.

50SP100SP200SP500SP1000SP2000SP5000SP

~comment by @aneukpineung78

I think I would love to travel to a planet named Gelato ;-)))

 2 months ago 

I see why, because it is where you and alien can dance happily to see so many gelatos.

Hehe, did you manage to watch them dance?

 2 months ago 

Not really, I was distracted by sooo many gelatos...

I will send you my space car. 😉

 2 months ago 

Your son is lucky to have a programmer mommy.

It's a fun activity for sure.

With my experience, I wouldn't call myself one. But I don't mind though. It was fun. Kids enjoyed doing the voice-over. Did you manage to watch it?

As far as I could remember we started with Pascal programming on DOS and Intel 80486 computers. It was 5th grade or maybe 6th.