When I was first told that we would be programming an app for an android phone I had no clue on what I was supposed to do. My first thought brought up long lines of random numbers and letters that some how create something, but after this unit I have realized how programming can actually be pretty simple.
Pictures of my App:
Whats going on behind the scenes:
The program shown above is an android app that I created using the program Scratch. In this program I created a cat that is chased by a lobster when you press the space bar on the moon. While the app is very simple there are different coding aspects that go on behind the scenes to allow the app to run.
The first picture of the blocks depicts the coding for the cat. I use multiple blocks to tell the program to start when I press space, make a sound, and write specific text. After that the code tells the cat to move 30 steps forward, move its paws, (to make it look likes its running), and turn at an angle. the code also tells the cat that if it hits a wall to bounce off that wall. Enclosing this code is a block to tells the program to continue running this evolution on repeat forever. This creates the video relay of the cat running all over the scene.
The coding for the lobster is similar but has a few minor differences. The lobster is also told to begin when the space bar is pressed, as well as saying a specific text, however instead of being told where it is to move on the screen, the lobster is programmed to follow the cat, making it look like it is chasing it. This code is put on repeat forever to make the visual effect of the chase.
Most of the coding the first time was trial and error until I was able to get the desired outcome. If i were to spend more time editing, and upgrading this application I would try to make it that the cat would instead follow the finger of someone on the phone screen, so if you drag your finger the cat would go there.