||To create a program in Scratch, you need to think systematically about the order of steps.This is basically what it means, a sequence. When you are making scripts, you have to be careful about the order of the blocks, as they will be important in how an object is programmed. A sequence is basically a list of blocks stacked in a certain order for something specific to happen.
|| I’m not too sure if there were any sequences in the fish game (because I think a lot of the orders of certain scripts were interchangeable). So as I don’t think it was used/I do not want to to not run the risk of giving a wrong example, I will retain the original example.
So for this example, the sequence is in a certain order for the script to work appropriately. When the space key is pressed, the sprite will go to the coordinates x=-100 and y=-100. After that, it will glide for 2 seconds to the coordinates stated, and then it will say let the show begin for 2 seconds, and then a fanfare sound will play. It can’t very well play the sound first, and then say the let the show begin, and then glide. This is why the order is important.
||forever and repeatcan be used for iteration (repeating a series of instructions)This is basically a script used to make something happen repeatedly, or to make something happen without an end.
Repeat and Forever
In this example, repeat is used to create the blinking effect of the shark when it eats the fish. The color and look of the shark is changed repeatedly to create animation.
The forever is used so that the shark will always follow the mouse pointer.
||if and if-elsecheck for a condition.This reminds me a lot of our excel project. It’s basically what its literal meaning is. “If” means if a requirement is filled, then something will happen (you can set what that something is). “If else” is basically the same as if, but there’s an else. The else means that if the requirement of if is not fulfilled, then something will happen.
If and If-else
The above example as used for the movement of the yellow fish. It means that if the requirement of if was fulfilled, then the sprite would go the the coordinates stated in the blue blocks. Else means that if “If” was not fulfilled then the coordinates in the blue blocks below else would be applied to the fish.
||The Variables category allows you to create a new variable and use it in a program.Scratch supports both global and object-specific variables.This is basically something that you can set for different purposes. It is basically, a variable. It can change depending on what you set for it. It can be used to calculate in-game scores, distances, etc.
So for the fish game, a variable (which was named score, for the purpose of, obviously, keeping track of the score) would be set to 0 at the start of the game. Then (as seen by the screen shot above), if the yellow fish touched the shark, it would change the score by 1 (meaning you would get one point). THis way, you could keep scoring and be able to tally it up.
|Launching two stacks at the same time creates two independent threads that execute in parallel.I’m not quite sure how this is that different from normal scripts to the point that it earns a separate term, but the best I can figure is this means when you have two scripts that are executed at the same time.
|| I’m not too sure if there were any threads in the fish game (as all of the scripts were mostly in one set, with the exception of different scripts for different broadcasts). So as I don’t think it was used/I do not want to to not run the risk of giving a wrong example, I will retain the original example.So in the example above, when the green flag (the start button, essentially) is clicked, both of the scripts will be executed at the same time.
||broadcast can coordinate the actions of multiple sprites.This was really useful. Basically, it sends out a signal to the program, and then depending on the signal, you set sprites and stages to react in different ways.
Basically, as explained above, it “broadcasts” a message to the program and you can set multiple things to react differently based on the signal being broadcast.
||mouse_x, mouse_y, and loudness can be used as dynamic input for real-time interactionI think this is just basically when you set things to happen constantly. Not sure how to classify this.
|| I’m not too sure if there were any real time interactions (unless you count the shark moving) in the fish game, so as I don’t think it was used/I do not want to to not run the risk of giving a wrong example, I will retain the original example.
Real time interaction
So this is basically a script for the loudness to be set at 4% throughout the game. It’s used for things like loudness. Still not really sure how t explain it.
||and, or, notare examples of boolean logic.This basically is used when you want to make something happen for more than one thing (e.g adding a requirement for IFS) (or, and), or if you want to to say if something is not fulfilled (not sure about boolean logic, truthfully. Haven’t used it).
|| I don’t think there was any boolean logic in the fish game, as I didn’t use any of the and, or, or notoperator blocks. So as I don’t think it was used/I do not want to to not run the risk of giving a wrong example, I will retain the original example.
So this basically means that only if both requirements are fulfilled (the sprite is touching that color, and the x coordinates of the sprite are 200), will the program play the sound “music” and change the score by 1.
||The pick randomblock selects random integers within a given range.This basically is a block that will set the program to pick random numbers (from a set of numbers given). This is done to make the game more unpredictable and make it seem more like a game. Refer to example —>
This was used to make the movement of the fish random and unexpected. In the example above, the script basically means:
go to x -240 y: pick random -190 to 190 – when it says x and y, it is referring to the coordinates (as in things like the x and y axis), so it means that the sprite will appear on the left edge of the screen, and will appear randomly in the y axis (basically the vertical coordinates at which it spawns will be random) between the coordinates -190 and 190 (top to bottom).
||when key pressed and when sprite clicked are examples of event handling – responding to events triggered by the user or another part of the programThis is basically when a user or another part of the program executes something, and you can format certain things to react based on what was executed,
|| I’ll use the original example, just in case:
This basically means that if the left arrow key was pressed, then the sprite would point in the direction of -90 and bove 10 steps that way.
|user interface design
||You can design interactive user interfaces in Scratch – for example, using clickable sprites to create buttons.This is basically programming a sprite to interact with the user. For example, by making it clickable and making something happen after clicking it. It’s similar to event handling.
|| I don’t think I used this for the fish game, so I’ll just use the original example:This example basically programs the sprite so that when it is clicked, the look (brightness) of the sprite changes, and a sound plays.