An after-school programming workshop.
Put on your best pair of coding pants because Scratch Day is coming to San Diego!
Saturday, May 12, 2018
9 am to 12:30 pm
Ada W. Harris Elementary School
1508 Windsor Road
Cardiff by the Sea, CA 92007
Scratch Day is free, but you must have an admission ticket in advance. Visit www.busylabs.org/scratchday/ for tickets and more information.
Our latest project involves a cat feeding tacos to flying hippos.
Each hippo must keep track of how many tacos it ate. We accomplish this using local variables. A local variable is only accessible to the sprite (e.g., hippo) it is associated with.
In our code, each hippo has its own tacos eaten variable that only it can read and write to.
In contrast to local variables, global variables can be read and changed by every sprite.
This week we had fun playing with 3-D glasses.
We first looked at amazing 3-D images online and tried to figure out how the 3-D effect was achieved. Next, we experimented with different sprites, colors and backgrounds to try and achieve our own 3-D effects. Some of the efforts were very successful.
We are working on a two player soccer game at Busy Labs.
Most of the game logic happens at the ball sprite. We test three conditions when the ball is kicked. If the ball touches the red portion of the goal, it counts as a goal and the dog gets a point. If the cat touches the ball or the ball goes too far to the left, the cat gets a point.
What’s your top score? I got up to 27.
This week we completed an apple catching game. The apples fall faster and faster as the game progresses. This is achieved by subtracting the score from the apple’s y-position. As the score increases, more is subtracted and the apple’s falling speed increases.
Scratch uses an x-y grid system to position sprites. To make a sprite fall, you need to decrease the sprite’s y-position.
In our latest project, we need to make an apple drop from the sky. This is accomplished by subtracting 5 from the y-position of the apple.
In our next meeting, we’ll continue creating an apple catching game.
There was some frantic coding going on at our last meeting. We created a Mad Libs program on Scratch.
The code was not too difficult to understand, but keeping track of all the inputs and variables quickly became difficult to manage in Scratch. If we do this project again, I would probably stick to four questions or less. In any event, the project was a lot of fun and the resulting stories were funny. See you at the next workshop.
At our last meeting, we created Rainbow Lines.
The project is from Al Sweigart’s wonderful book Scratch Programming Playground. This book offers a great introduction to Scratch’s capabilities with creative and enjoyable projects.
This particular project requires three bouncing balls. A fourth Controller sprite jumps between the balls and draws lines of continuously changing colors. Here’s what the Controller sprite’s code looks like:
The library will be open for our next meeting, but Ido will not be instructing.
We’ve been making maze adventure games lately at Busylabs.
This is a great project because the basic game code is very accessible. Here’s the code structure:
Although the code is simple, it offers endless possibilities for modification and improvement. Locked passages, traps, multiple goals and enemy sprites can be quickly added to the game. A timer can keep track of the best time for completing the maze. Different mazes can be created to add more levels to the game. These are just some of the ideas the kids came up with to spice up the game.
Just in time for Halloween, our spider game is complete! This week we added the beetle sprite and sound effects. We had a great time building the game. We will start a new project at our next meeting.
At our last meeting, we continued working on our spider game. We added a butterfly to the game that gets stuck on the spider’s web. We also gave the spider the ability to swoop down and try to catch the butterfly when the spacebar is pressed.
Swooping down is a little tricky because the spider has to stop swinging when swooping. This is achieved with a moving variable and an if-statement. The butterfly code is not too difficult. The butterfly first glides to a random location. If the spider touches the butterfly, the butterfly moves with the spider up the web. The butterfly then hides and glides to a new random location.
We’re getting close to finishing the spider game. Just another sprite and maybe some sweet sound effects.
Halloween is coming and this week we started constructing a scary spider game. In the game, you are a six-legged spider tying to eat as many butterflies as possible while avoiding a beetle that is immune to your predatory ways.
Our game design requires the spider to swing back and forth. To achieve this effect, a loop checks if the spider’s angle is greater than -135 and 135 degrees. We use the direction’s absolute value to check positive and negative values at the same time. If the angle is too big, the rotation direction is reversed by multiplying the rotation direction by -1.
rotation-direction = 1 ... if (abs(direction) > 135)) then rotation-direction = rotation-direction * -1 turn (1 * rotation-direction)
Next week we will continue working on the game by giving our spider the ability to swoop down and catch butterflies.
This week we worked on “Monsters telling jokes” projects. We found images of monsters on the web and downloaded them into a scratch program. We then recorded a joke and animated the monster to talk in sync with the joke. The jokes are wonderfully bad! Check some of the projects here.
At our last meeting, everyone showed their “Animate Your Name” project. This project involved creating animations when letters of your name are clicked. There were some really creative animations, including dancing, exploding and skateboarding letters.
Join us at the next meeting, when we will be programming Scratch to tell jokes.
Thank you for attending the first Busy Labs computer programming class. I hope you had a great time getting the “Animate Your Name” project started. Please complete your project at home so that you can show it off at our next meeting.
If you need animation ideas for your letters, check out the Busy Labs project or search the Scratch website for other Animate Your Name projects. Don’t forget, if you get stuck there’s a great discussion board on the Scratch website where you can submit questions about your project.
For our next meeting, we’re going to use Scratch to tell a joke. Please think of a joke to record. The joke can include dialog by multiple people, such as a Knock Knock joke.