In SNAP!, a reporter block is used to report a value, which is generally used as an input to another block. What do reporter blocks look like? Reporter blocks can be easily identified in the palette as they have reporter shape (round). For example, the following blocks in the Motion […]
Category: Learn to Code
Custom Code Blocks: Functions with Parameters
Last week we covered an important computer science concept, Variables, and how to use them in a simple jump example. Variables gives us the ability to store a value and track/modify/use it throughout the program. Additionally, last month, we had covered the concept of functions. Functions are a great way […]
Variables
In my previous blog, we covered how you can customize your script to take user input and make your sprite jump to the height specified by user. Now let’s extend the previous scenario to asking user input for both height and length of the jump. How would you enhance your […]
User Input in SNAP!
In previous blogs, we have covered different aspects of coding practices using a simple Sprite Jump example. In this blog, I will build on top of the code we built in Good Coding Practice: Using Relative Coordinates. Here is what our Sprite Jump code looked like: Now let’s say we […]
Simple Code Blocks: Using Functions
Let’s say you create 3 sprites (of ball shapes – learn how to change the sprite’s costume): one of color Red, other of Blue and last one of Green. Now you want all three to jump when different keys are pressed. For example, Red one should jump when key ‘a’ […]
Good Coding Practice: Using Relative Coordinates
In the previous blog, we covered how to make the sprite jump, and this is what our script looked like: What will happen every time you click on green flag? The sprite will come to the center of the stage (coordinates [0,0]) and then glide to [20,20] coordinates and then […]
Simulating a Sprite’s Jump in SNAP!
This blog post will illustrate how we can make a sprite jump in SNAP! Now to make a sprite jump, it should first look like an object which can jump. Checkout my previous blog post on how to change sprite’s costume to give it the shape of a ball. Once […]
Change Sprite’s Costume in SNAP!
This blog post will illustrate how we can change the costume of sprite in SNAP! To use SNAP!, open the link in your web browser: http://snap.berkeley.edu/snapsource/snap.html If you already have an account, you can login using it, or create a new one, or use SNAP! Without any login. In SNAP!, […]
Learn to Code
In 2015, when I was working with Microsoft, I got an opportunity to volunteer with TEALS to teach Introduction to Computer Science to high school students. I enjoyed doing to it so much that it became the most enjoyable part of my day soon. I looked forward to it every […]