Programming games Classwork: Show Favorite Sites. Show coin toss. Review concepts. Crooked coin toss. Homework: Complete coin toss examples. Upload files.

Slides:



Advertisements
Similar presentations
CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
Advertisements

CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
CIS101 Introduction to Computing Week 06. Agenda Your questions Resume project HTML Project Two This week online Next class.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
CIS101 Introduction to Computing
CIS101 Introduction to Computing Week 10 Spring 2004.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
CIS101 Introduction to Computing Week 06. Agenda Your questions Resume project HTML Project Two This week online Next class.
Images By Tara Frieszell By Tara Frieszell. Adding images to your website will make it more interesting and add to the design. However, some viewers aren’t.
Create Your Own Webpage. Today’s Agenda Cut & paste code Notepad++ or Notepad at home FTP Web Hosting Wordpress.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Basic Web Page Design. Text book: HTML, XHTML, and CSS: Visual QuickStart Guide, Sixth Edition written by Elizabeth Castro. Software: Adobe® Dreamweaver®
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
Programming Games Computer science big ideas. Computer Science jargon. Show virtual dog Homework: [Catch up: dice game, credit card or other form.] Plan.
Create Interfaces College exercise. Continue HTML5: HTML5 logo, drawing images. Coin toss. Homework: acquire video & audio.
Website Development & Management Getting to Know HTML Better CIT Fall Instructor: John Seydel, Ph.D.
Pre-Coding Web Design – Sec 3-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Programming games Recap. Upload work (Filezilla, index.html). Drawing lines. Drawing stars. Homework: Drawing exercises.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Tutorial #2 Creating Links. Tutorial #1 Review Basic Page (DOCTYPE, HTML, Head, Title, Body) Tags Structure( ),,,,,, Nested Tags content Tag Attributes.
Programming Games Basic HTML5 audio example. Catch-up. Work on basic video. Homework: Complete basic video.
IT Introduction to Website Development Welcome!
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Websites 101 Technology Committee UPSOM. Web Class – Goals  Make a simple web page (or series of pages)  Upload that page to the internet  Feel comfortable.
Programming Games Google Map API examples. CSS. Classwork/homework: Catch up. Upload work. Show your [more] complex Google Maps API example. Plan your.
Processing.js.
Programming games Reprise: coin toss on canvas. Dice game rules. Global and local variables. Homework: [Catch up. Upload projects, including index.html.]
CM143Web Week 8 Review of Assignment 1 Revision & Elaboration.
Dreamweaver Edulaunch Project 1 EQ: What are the key concepts when building the first page of a web site?
Enhancing Your Web Site—Adding Links Web Page **YOU MUST HAVE COMPLETED THE 1ST 3 WEB PAGES BEFORE YOU CAN DO THIS ONE. **YOU SHOULD HAVE COMPLETED THE.
HTML Concepts and Techniques Fifth Edition Chapter 6 Using Frames in a Web Site.
Definition CSS “Short for Cascading Style Sheets, a new feature being added to HTML that gives both Web site developers and users more control over how.
WRT235: Writing in Electronic Environments Session 2 Basic XHTML.
WRA 210: MODULE 3 &PORTFOLIO SESSION 2: STUFF TO REMEMBER Do the readings. It helps, seriously. Ask questions. It’s OK to interrupt me (not others).
Programming games HTML/JavaScript basics Functions, events, forms Classwork: [Show favorite sites.] Coin toss. Homework: GET WEB SPACE. Complete coin toss.
Technology Vocabulary By: Rakeysha Patterson. Search Engine  A computer program that searches documents, especially on the World Wide Web, for a specified.
Uploading Information to the Website. Uploading Information Uploading information to the website is very simple. Our website is updated through a system.
Creating Web Documents catch-up JavaScript slide show tools redirection.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
Programming Games Logic. Slide show. Range input. Storage. Datatypes. Binary numbers. Homework: Catch up. This includes uploading projects to your server.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Programming games Review concepts. Crooked coin toss. Drawing on canvas. Homework: Complete [static] drawings. Upload files to website.
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
COMP 2923 A2 Website Development 101 Danny Silver JSOCS, Acadia University.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
Programming Games Reprise: credit cards. Show video projects. Demonstrate Find Daniel and Virtual Dog. Homework: [Catch up.] Post proposal for your JavaScript.
Navigating the Course 1. Course Materials 2 Software: Notepad (or TextEdit on a Mac) – comes with operating system Internet Explorer Web Browser FireFox.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
HTML. Hyper Text Markup Language Markup your text document The markup is the tag Hyper text means you can jump from place to place Programming language.
Basic Web Page Design. Text book: HTML, XHTML, and CSS: Visual QuickStart Guide, Sixth Edition written by Elizabeth Castro. Software: Adobe® Dreamweaver®
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Programming games Show work on site. Work on slide show. Timed event for bouncing ball. Homework: [Finish slide show and upload to site.] Acquire a short.
Basic Web Design UVICELL Week 4 Templates and site management Week 4 Templates and site management.
Programming games HTML/JavaScript basics Functions, events, forms
Programming games HTML/JavaScript basics Functions, events, forms
Programming Games Work / finish and show dice game. Extras. Timed events. ftp. index file. Homework: Catch up and do slide show.
© 2015, Mike Murach & Associates, Inc.
Art 128 Interface Programming 1 In-class Presentation Week 2B
HTML Lesson 2.
HTML.
Basic HTML and Embed Codes
Context of what we are doing.
Programming games Share your plans for your virtual something.
Web Programming and Design
Web Programming and Design
Presentation transcript:

Programming games Classwork: Show Favorite Sites. Show coin toss. Review concepts. Crooked coin toss. Homework: Complete coin toss examples. Upload files to your Purchase website. Try codeacademy.

What is… a function? –how is it defined? –how is it called? What is the name of the function you defined in your coin toss application?

JavaScript function definition function functionname (args if there are any) { statements }

Function call Multiple ways to set up to be response to a button –A form is an html element. –A new html element is button TOSS –other ways…

Event handling Speaking in general terms about something set up a variety of ways. Set up the when this event happens, … do this, maybe call this function Terms used: –event listener –event handler –event catcher sometimes restricted to potential errors: try { } catch

Other Function calls In tag as value of href Call fun In tag as value of onClick, onMouseover or onMouseOut Set up to be called after time interval. This statement will be somewhere in the code, perhaps within another function. tid = setInterval("moveit(dx, dy)",500);

Coin Toss function toss() { if (Math.random()>.5) { document.coin.src = "head.gif"; } else { document.coin.src = "tail.gif"; } return false; } FLIP COIN

Biased coin How to change your program from a fair coin to a biased coin? How to make it produce (over time) twice as many heads as tails? How to make it produce (over time) heads 60% of the time and tails 40% of the time?

Keeping counts One approach –use form element –Note: the input elements actually are used for output: output to show player Heads: Tails:

Problem There is a difference between text and numbers, so…. need to extract the text value, convert to a number, add 1, then convert back. // for the head case document.f.hc.value = String(1+Number(document.f.hc.value) ); So where do you put this and what do you do for the tail case?

Classwork Complete and show your fair coin toss. Save under new name and make a biased coin –Precisely biased! Save under new name and enhance the fair coin toss and the biased coin toss to show counts.

Reading code: sketch First html Annika's first Halloween Costume by Aunt Aviva Knitting information

Folders Browsers provide a way to specify which file to open if no file is mentioned. This is the index.html file. Let's assume you made a folder called pg to hold all your Programming Games work. pg will cause browser to look for a file named index.html in the pg folder.

index.html My Games Programming Games My Favorite Sites Coin toss Biased coin

Folder for images You can make a folder for images –Then the reference from the html file must be correct! Or not….. May make more sense to make separate folders for the large[r] applications

doctype The first line of an HTML5 file should / can /maybe must for some browsers be For your own copy of sublime: –At some point, you should pay for this.

ftp file transfer protocol Many programs available. We use Filezilla Demonstration

codeacademy There are many sources online to help you. One is This includes a terminal/console mode that returns the value of each expression. Try the first lesson (or more) and post a comment on moodle.

Homework Complete coin toss projects. –Make file names without spaces. Prepare index.html file (This is a table of contents) with links to your projects. Put it in the web folder OR a new subfolder called pg or games Upload the index.html file and all your projects –html files and other files…. You will keep updating the index.html file as you add new projects. Do first course (8 short lessons) in codeacademy. –comment on moodle forum for this week!

Required Master editing using TextWrangler (or Text Pad) or Sublime Master ftp, using Filezilla (or equivalent ftp program) to upload to YOUR PURCHASE website –Using the virtual disk tends to be problematic! Master using Filezilla to download from your server to your computer. Master modifying your index file and uploading again

Web site It may make sense to make a directory/folder for this class. You can call it pg Put the index file in that directory Put your application files in that directory –the.html files and all image files. So.. students.purchase.edu/jane.doe/pg will open up that file. faculty.purchase.edu/jeanine.meyer actually opens a file called index.html