Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Under the hood”: Angry Birds Maze

Similar presentations


Presentation on theme: "“Under the hood”: Angry Birds Maze"— Presentation transcript:

1 “Under the hood”: Angry Birds Maze
LESSON 2: Java Script “Under the hood”: Angry Birds Maze

2 History First web scripting language Developed by Netscape and Sun
Initiated by Netscape and called LiveScript In parallel with this, Sun was developing Java

3 Why Use JavaScript? JavaScript enhances Web pages with dynamic and interactive features.

4 What can JavaScript Do? JavaScript gives HTML designers a programming tool JavaScript can react to events Validate data It can be used to detect the visitor’s browser Create cookies Read/write/modify HTML elements

5

6 Functions Functions are named statements that performs tasks.
e.g., function doWhatever () {statement here} The curly braces contain the statements of the function. JavaScript has built-in functions, and you can write your own.

7 Values Values are bits of information.
Values types and some examples include: Number: 1, 2, 3, etc. String: characters enclosed in quotes. Boolean: true or false. Object: image, form Function: validate, doWhatever

8 Variables Variables contain values and use the equal sign to specify their value. Variables are created by declaration using the var command with or without an initial value state. e.g., var month; e.g., var month = April;

9 JavaScript terms Binary Code: Compiler: Condition: Interpretation:
Machine Readable Code (After JavaScript code has been translated by interpretation, it becomes binary code Compiler: Highly specialized piece of software that takes a programming language that humans can understand and converts it into language computers can understand Condition: A conditional statement tells the browser IF this condition is met, perform this function; if not (ELSE) perform a different function Interpretation: Describes the line-by line conversion process that occurs automatically at run time or when the Web browser launches the JavaScript commands that are embedded in the Web document

10 Terms (continued) Keywords: Parameter List Programming Language
Word recognized by the programming language as part of its language (IF, ELSE, RETURN) Parameter List A list of information that provides a programming method what it needs to perform a specific function correctly. Programming Language A language that has to be converted from a human-readable format into machine-reada ble format. This process is accomplished by using a compiler to complete the operation. Scripting Language Language that does not have to be run through a compiler for it to be understood. Web browsers will take the human-readable format and convert it into machine-readable format “on the fly”.

11 JavaScript “Under the Hood”

12 Assignment See directions on Worksheet: Java Script Assignment (2-sided) PART 1 Transcribe, by hand, the JavaScript code “Under the Hood” for puzzles Number each lesson, then transcribe the code EXACTLY as it appears “Under the Hood” after completing each puzzle Be precise on Indentation and Spacing (see example on Board) For puzzles 11 thru 20 copy and paste the JavasScript (Under the Hood” on a WORD doc (not Google doc), number each lesson (see example)

13 Example: Transcribing, by hand, Lessons 1 - 10
moveForward(); moveForward(); moveForward(); moveForward(); moveForward(); moveForward(); for (var count = 0; count < 5; count++) { moveForward(); } Example: Transcribing, by hand, Lessons Puzzle # Code (Under the Hood) Number moveForward (); moveForward (); for (var count = 0; count < 5; count++) { moveForward(); }

14 Assignment (continued)
PART 2 Complete Worksheet: Java Script Assignment (2-sided) Using the Four Functions introduced through video clips in the “Angry Bird Maze” write a brief description of why/when/how each command is used (review video clips if necessary) REPEAT (Puzzle 6) REPEAT UNTIL (Puzzle 10) IF (Puzzle 14) IF/ELSE (Puzzle 18)


Download ppt "“Under the hood”: Angry Birds Maze"

Similar presentations


Ads by Google