Application Day: Branching Adventure.  Quiz  Let's look at the schedule  Branching Adventure - explanation  Branching Adventure – work time 2.

Slides:



Advertisements
Similar presentations
Brain Challengers!!!.
Advertisements

SEN In, Out and Beyond Safe In The Community Memory Game.
MIXER Scenarios. Structure (blue = FearNot, red=user interaction) EPISODE 0: Initial Introduction to context EPISODE 0: Initial Introduction to context.
Order of Operations And Real Number Operations
How to study for A&P Adapted from “get ready for A&P” By Lori K. Garrett.
Review of Exercises from Chapter 17 Statistics, Spring
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
CIS101 Introduction to Computing Week 12 Spring 2004.
ScannersScanners How to use them to scan pictures and documents.
The preprocessor and the compilation process COP3275 – PROGRAMMING USING C DIEGO J. RIVERA-GUTIERREZ.
JQuery CS 268. What is jQuery? From their web site:
WML, WMLS More acronyms than you can shake a stick at!
1 Week Three: Using Scripts and Forms in HTML (Week Three) By Dr Fadi Safieddine.
BIT 115: Introduction To Programming1 Sit in front of a computer Log in –Username: 230class –password: –domain: student Bring up the course web.
Introduction Tasks Process Evaluation Conclusio n Hey Kids! Johnny is going to play a game today after school. He needs to eat the right foods to make.
More JavaScript Examples Please use speaker notes for additional information!
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
Visual Basic Games: Prepare for Hangman
Building a Mindmap about Chapter One Let’s Communicate.
Word Revise documents and keep track of changes. Use Track Changes and comments Course contents Overview: Insertions, deletions, comments Lesson 1: Stay.
Cornell Notes Note-taking strategy that will improve your study skills and your grades!!
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
BIT 142:Programming & Data Structures in C#. BIT 142: Intermediate Programming2 Today Quizzes Exam Review Catch-up Work.
Challenges of collecting data with young children Tricia Shaw - University of Hull.
BIT 115: Introduction To Programming Instructor: Mike Panitz
BIT 116:JavaScript. BIT 116: Scripting2 Today Ch 9: Object Oriented Programming, Part 1 –Random numbers –Basic OOP stuff Reading quiz turned in?
BB LEARN ORIENTATION ENGLISH 101 College Composition.
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
BIT 115: Introduction To Programming. 2 What’s Due When Listed in Course Schedule Let’s look at that now!
Department Name (View Master > Edit Slide 1) JQuery I took these slides from the site because they were pretty good looking.
Coming Up: Today: Review Quiz 2 Lecture on Section 2.4: Word problems! NOTE: This homework is due at the beginning of the next class session. Coming up.
1 JavaScript
The images that you are now viewing are part of a larger picture, not unlike a puzzle. See if you can predict what other images will complete the puzzle/picture.
Conditional Statements.  Quiz  Hand in your jQuery exercises from last lecture  They don't have to be 100% perfect to get full credit  They do have.
Loops.  (No Quiz)  Hand in Assignment #1  Last chance for Q+A on the midterm  Loops 2.
Intermediate 2 Computing Unit 2 - Software Development.
Radio Buttons.  Quiz  Radio Buttons  Check boxes 2.
BIT116: Scripting Associative Arrays. Today AngularJS Q + A for the exam 2.
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
Stressed for your Test? Not anymore!. Acing a test: 3 Key factors  Taking good notes  Without a good outline to study from, you will either learn too.
Day 3. 1) A vocabulary sheet is posted on my main page. You will need to copy the words from the sheet and paste them to your word document. Make sure.
Opening. Two heads Before proceeding find a partner to go through the next slides with you. If you don’t have a partner be sure to share this later with.
Functions.  Assignment #2 is now due on Wednesday, Nov 25 th  (No Quiz)  Go over the midterm  Backtrack and re-cover the question about tracing the.
Project Two Adding Scrolling Messages! Page 2.4 to 2.18 Today’s Agenda Look at scrolling message coding. Create a web page with a text box. Create a web.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
8 th Grade Week 20 Agenda & Objectives 1/14/13-1/18/13 Monday: Review Tuesday & Wednesday: Final! Thursday: Make up/Corrections Friday: Diary of Anne Frank.
Logical Operators.  Quiz  Let's look at the schedule  Logical Operators 2.
Check Boxes. 2 Check boxes  Image from:  HTML:  Each box gets it's own.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
How to use Moodle Spring 2012 PowerPoint Created by Erin Pence & Mike Seeley Any questions, us at
Coming Up: Today: Review Quiz 2 Lecture on Section 2.4: Word problems! NOTE: This homework is due at the beginning of the next class session. Coming up.
CSS 290: Video Games and Computer Programming Instructor: Mike Panitz Tuesdays and Thursdays, 1:15pm-3:20pm UW
1 1.Log in to the computer in front of you –Temp account: 210class / 2.Update your in Cascadia's system –If I need to you I'll use.
BIT 115: Introduction To Programming. 2 Today Midterm feedback Getting User Input.
Title of your site Title of your page Text and images arranged on the page in the design of your choice. Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page.
Guide to Using MYIBS Online Course Repository System using Claroline For IBS Students Only.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
BIT116: Scripting Lecture 05
Hidden Slide for Instructor
BIT116: Scripting Lecture 06
BIT 116:JavaScript.
BIT116: Scripting Functions.
BIT 116:JavaScript.
Due Next Monday Assignment 1 Start early
BIT116: Scripting Radio Buttons.
Front End Development workshop
Retrieving information from forms
Presentation transcript:

Application Day: Branching Adventure

 Quiz  Let's look at the schedule  Branching Adventure - explanation  Branching Adventure – work time 2

 Assignment 1 ("A1") was posted last Friday  It's due on November 4 th (that's 1.5 weeks from today, and 1 week from next class)  You can (and should!!!) start work on it ASAP  We'll cover logical operators next class, which is the last piece you need to complete it.  The Midterm is on Monday, November 9 th, in class  The exam will be paper and pencil  You WILL be allowed to use your 3x5 card on the exam  I will be focusing on in-class exercises, material from the slides, and quizzes  MAKE SURE THAT ANYTHING YOU KNOW HOW TO DO ANYTHING THAT YOU MISSED ON ANY QUIZES!!!  I'll provide more detail later 3

4 Branching Adventure

 First, let's play the game a bit  Second, state machine diagram  We'll use a number for each state 5

Branching Adventure!!!  Heading 1 will remain unchanged  The will show the picture + text with a different image for each state  The is currently unused, but we could use it to display messages  The three buttons will always be present on the page  We'll show/hide them based on the number of buttons we actually need for each state  We'll have a single function react to handle any of them being clicked 6

$(document).ready( function() { $("#choice1").click( onClick ); $("#choice2").click( onClick ); $("#choice3").click( onClick ); // Set up the game to start: currentState = 1; $("#thePicture").attr("src", "image01.png"); $("#choice1").val("Click here to start!"); $("#choice2").hide(); $("#choice3").hide(); });  $("#choice1").click( onClick ) = Tell jQuery to use the onClick function to handle clicks  onClick is declared right after this  currentState = 1; = remember that we're in state #1  $("#thePicture").attr("src", "image01.png"); = We need to manually change the image to match the current state  $("#choice1").val("Click here to start!"); = This sets the text on the first button  $("#choice2").hide(); = This hides the second button (etc.) 7

var whichButton =0; if( $(this).attr("id") == "choice1") whichButton = 1; else if( $(this).attr("id") == "choice2") whichButton = 2; else if( $(this).attr("id") == "choice3") whichButton = 3;  It's easier to deal with a number than a button, generally  So we'll figure out which button was clicked, and set whichButton to 1, 2, or 3  This will simplify the rest of the function  if( $(this).attr("id") == "choice1") =  $(this) is whichever button was clicked .attr("id") gets the id attribute  == "choice1" checks if that attribute is the same as the string (text) "choice1"  whichButton = 1; = then assign 1 to the variable 'whichButton' 8

else if( currentState == 2) { // They're "in town" if( whichButton == 1) { // If they chose "go find the dragon": currentState = 3; $("#thePicture").attr("src", "image03.png"); $("#choice1").show().val("Try to talk your way out of this one"); $("#choice2").show().val("Fight the dragon!"); $("#choice3").hide(); }  else if( currentState == 2) { = We've got a giant multiway if/else, one for each state  if( whichButton == 1) { … } = do this if they clicked the first button  The stuff in the middle says which state to change to (in this case, 3), loads up the new image ( "image03.png"), hides any unused buttons (such as #3), shows the used buttons and adjusts their text (more detail on this next slide) 9

else if( currentState == 2) { // They're "in town" if( whichButton == 1) { // If they chose "go find the dragon": currentState = 3; $("#thePicture").attr("src", "image03.png"); $("#choice1").show().val("Try to talk your way out of this one"); $("#choice2").show().val("Fight the dragon!"); $("#choice3").hide(); }  $("#choice1") = select the first button – this is normal jQuery that we've seen before  show() = show the button if it was previously hidden. .val("Try to talk your way out of this one"); = set the text on that same button (button #1)  Notice the '.show().val()' chain of method – this is a jQuery idiom, and ( I believe) one of the reasons why it's so popular 10

 Work on Exercise #1 for the 'Branching Adventure' part of this lecture 11