Menu
Home Page

Computing

Coding Efficiently

 

 

Vocabulary

Event: An occurrence that causes a block of code to be run. The event could be the result of user action such as the user pressing a key (when Key) or clicking or swiping the screen (when Clicked, when Swiped) or when objects interact (collision). In 2Code, the event commands are used to create blocks of code that are run when events happen.
 
Object: Items in a program that can be given instructions to move or change in some way (action). In 2Code Gorilla, the object types are button, number, input, text, shape turtle, character, object, vehicle, animal.
 
Action: The way that objects change when programmed to do so. For example, move.
 
Variable: A named area in computer memory. A variable has a name and a value. The program can change this variable value. Variables are used in programming to keep track of things that can change while a program is running.
 
Selection: Selection is a decision command. When selection is used, a program will choose which bit of code to run depending on a condition. ‘If’ and ‘if\else’ statements are often used in selection.
 
Co-ordinates: Numbers which determine the position of a point, shape or object in a particular space.
 
Input: Information going into the computer. This could be the user moving or clicking the mouse, or the user entering characters on the keyboard. On tablets there are other forms such as finger swipes, touch gestures and tilting the device.
Can you predict what will happen when this program is run?
How will the player make the animals move?

 

 

 

2DO: Race 1

Look at this code. It’s much shorter than the code on the previous slide.
Can you predict what will happen when this program is run?
How does it work?
 
  
 
In the program, all objects are the same object type (animal).
2Code can identify any object clicked on in a group of objects of the same object type.
 

Mr. Ejaz has set an activity on PurpleMash called CATCHING GAME, lets program a game.

 

Top