Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types.

Similar presentations


Presentation on theme: "Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types."— Presentation transcript:

1

2 Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types.

3 Variables / Constants….
Known as a place holder to store values. Can be shown in a number of data types Constants Constants are a little different to normal variables in that they cannot be modified. To add in a variable / constant using touch develop we click on: When teaching my students I sometimes refer to a variable as a BUCKET. They can imagine how it holds the value and how it can be emptied and used again.

4 Data Types…. What would you use them for?
This are common ones which are used within TouchDevelop. Get your students to see if they can see the ones which are likely to be used the most? What would you use them for?

5 Only two outcomes – True or False
One bit of information Only two outcomes – True or False Used for simple flags to track true or false conditions. Default value is false. Boolean

6 The board is the 2D engine which lets you create the game.
You can move objects around on it according to gravity or friction. You can use the board to time elements. Without the board, you will find it difficult to move characters around your screen. Imagine it as your interface. Without setting up the board, you will not be able to control the appears of your game.

7 We use Numbers because they help us later on in whatever job we will need our code to do.
For instants, if we need to calculate numbers. It isn’t good trying to add text together, the program will give you an error. Number variables allow us to use only numbers whereas strings allow a combination of numbers and letters.

8 Sometimes it’s not good enough to just calculate things
Sometimes it’s not good enough to just calculate things. We might need to name them. It is not possible to put a persons name inside a number variable. It will give us an error message. Strings allow us to use a combination of numbers and characters providing them they have been converted.

9 This data type is used to specify a date.
Within Touch Develop you can call on specific functions such as just the time or the date. You can push buttons such as: When you push these buttons, they store these values within the variable. You can pick either the date or time.

10 A Sprite is an object or set of objects which performs an action.
If you have used scratch before, you will already understand this. Sprites can be programmed to carry out different activities. Most projects have at least one sprite. There are four kinds of sprite that display different kinds of visual content: ellipse, rectangle, text andpicture. They can have the shapes of ellipses or rectangles. They can be drawn as solid figures, or they can take the form of a piece of updatable text, or be created from a picture. There is a fifth kind of sprite known as an anchor sprite. It is invisible and has a special purpose, which is explained below under the headingsprings and anchors. Sprites are associated with particular game boards and are created by methods of the Board type.

11 Useful Videos Here is some mapping to videos which use some of these data types: Video 1 – Introduces height and width using the board and number data types. Video 2 – Sprite data types introduced. Video 7 – Uses strings in a list. Experiment with the data types and see what you can come up with.


Download ppt "Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types."

Similar presentations


Ads by Google