SlideShare a Scribd company logo
Interactive Graphics
   w/ Javascript,
  HTML5 and CSS3
      Lee Lundrigan
       Sarah Allen
Class Materials

• You will want to get:
  • https://github.com/blazingcloud/
    simple_animation

  • git@github.com:blazingcloud/
    simple_animation.git
Who are we?

• Blazing Cloud, Inc.
  • Product Development Consultancy
  • Training
• Lean Startup, Customer Development
• Languages: HTML, CSS, Javascript,
  Ruby, Objective-C, Java
Who are we?
• Lee Lundrigan
 • iOS, Mac and Mobile Web specialist
 • Wrote a cross mobile browser CSS
    framework that ran on iPhone,
    Android, Blackberry and WinMo

• Sarah Allen
 • 20 years of Product Experience
 • After Effects, Shockwave, Flash
    video, Open Laszlo, Lean Startup
Who are YOU?
Tools of the trade
• Oxygen XML Editor
 • http://www.oxygenxml.com
• Aptana
 • http://www.aptana.com
• TextEdit (on Mac)
• TextPad (on Windows)
Course Topics
• Animation
  • 2D and 3D / HTML5 Canvas
  • Collision detection
  • Sprites
  • Sound
• Interaction
• Best practices
Vocab


vec·tor /ˈvektər/
Noun: A quantity having direction as
well as magnitude, esp. as determining
the position of one point in space
relative to another.

                         10
                               15
hertz (Hz)
a unit of frequency of one cycle per
second. Ex. 60Hz = 60 times per second

’tween/twēn/
Contraction: time between. The process
of creating in between frames.
Coordinate System

• Cartesian Coordinate System
 • Starts in upper left
 • Origin is (0,0)
                   0
               0
Animation

• setInterval(code,millisec);
  • repeats until cleared
• setTimeout(code, millisec);
  • Fires the event once
• Note: There are 1000 milliseconds in
  one second.
Animation Cont...


function draw() {
    ball.x += 10;
}
Lab - Simple Animation
Collision Detection


• Bounding box
• Test using object’s center
  • {x: 10, y: 10}
Sound

• HTML5 <embed> Tag
  <embed src="pong.mp3" id=”pong
  ”width=”0” height=”0”
  autostart=”false”/>
• Get the object by id
• Call the Play() method
Keyboard Movement
• document.onkeydown
 • detect character code
   • left: 37 right: 39
 • set moving true
• document.onkeyup
 • set moving false
Keyboard Movement
        Cont...


• Webkit based browsers have a bug
 • the keypress event doesn’t work for
   the arrow keys
Lab - Game time

More Related Content

Similar to Interactive Graphics w/ Javascript, HTML5 and CSS3

Augernaut js
Augernaut jsAugernaut js
Augernaut js
mckennaphillabaum
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
Lohith Goudagere Nagaraj
 
Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web Development
Robert Dawson
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsersnoweverywhere
 
Reality As Your Next Build Target, Mobile AR, and the Future of Authoring
Reality As Your Next Build Target, Mobile AR, and the Future of AuthoringReality As Your Next Build Target, Mobile AR, and the Future of Authoring
Reality As Your Next Build Target, Mobile AR, and the Future of Authoring
Unity Technologies
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive GraphicsBlazing Cloud
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5
Roy Clarkson
 
It next summit - holobasics - develop your mixed reality hololens app with un...
It next summit - holobasics - develop your mixed reality hololens app with un...It next summit - holobasics - develop your mixed reality hololens app with un...
It next summit - holobasics - develop your mixed reality hololens app with un...
Alexander Meijers
 
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech ArtPhillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
AugmentedWorldExpo
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
Mark Billinghurst
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
Naga Harish M
 
Playing in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte ScalePlaying in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte ScaleMongoDB
 
Harmony intune final
Harmony intune finalHarmony intune final
Harmony intune finalMongoDB
 
Modern UX, UI, and front-end tools
Modern UX, UI, and front-end toolsModern UX, UI, and front-end tools
Modern UX, UI, and front-end toolsAlan Roy
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
livedoor
 
Developing for Leap Motion
Developing for Leap MotionDeveloping for Leap Motion
Developing for Leap Motion
Iris Classon
 
Learning JavaScript Programming
Learning JavaScript ProgrammingLearning JavaScript Programming
Learning JavaScript Programming
Hriday Ahmed
 

Similar to Interactive Graphics w/ Javascript, HTML5 and CSS3 (20)

Augernaut js
Augernaut jsAugernaut js
Augernaut js
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web Development
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsers
 
Reality As Your Next Build Target, Mobile AR, and the Future of Authoring
Reality As Your Next Build Target, Mobile AR, and the Future of AuthoringReality As Your Next Build Target, Mobile AR, and the Future of Authoring
Reality As Your Next Build Target, Mobile AR, and the Future of Authoring
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5
 
Yavorsky
YavorskyYavorsky
Yavorsky
 
It next summit - holobasics - develop your mixed reality hololens app with un...
It next summit - holobasics - develop your mixed reality hololens app with un...It next summit - holobasics - develop your mixed reality hololens app with un...
It next summit - holobasics - develop your mixed reality hololens app with un...
 
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech ArtPhillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Playing in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte ScalePlaying in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte Scale
 
Harmony intune final
Harmony intune finalHarmony intune final
Harmony intune final
 
Modern UX, UI, and front-end tools
Modern UX, UI, and front-end toolsModern UX, UI, and front-end tools
Modern UX, UI, and front-end tools
 
3d internet
3d internet3d internet
3d internet
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
 
Developing for Leap Motion
Developing for Leap MotionDeveloping for Leap Motion
Developing for Leap Motion
 
Learning JavaScript Programming
Learning JavaScript ProgrammingLearning JavaScript Programming
Learning JavaScript Programming
 

More from Blazing Cloud

Rails ORM De-mystifying Active Record has_many
Rails ORM De-mystifying Active Record has_manyRails ORM De-mystifying Active Record has_many
Rails ORM De-mystifying Active Record has_many
Blazing Cloud
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3
Blazing Cloud
 
Rails Class Intro - 1
Rails Class Intro - 1 Rails Class Intro - 1
Rails Class Intro - 1
Blazing Cloud
 
Your first rails app - 2
 Your first rails app - 2 Your first rails app - 2
Your first rails app - 2
Blazing Cloud
 
RSpec Quick Reference
RSpec Quick ReferenceRSpec Quick Reference
RSpec Quick ReferenceBlazing Cloud
 
Extending rails
Extending railsExtending rails
Extending rails
Blazing Cloud
 
2day Ruby Class Intro
2day Ruby Class Intro2day Ruby Class Intro
2day Ruby Class Intro
Blazing Cloud
 
Mobile Lean UX
Mobile Lean UXMobile Lean UX
Mobile Lean UX
Blazing Cloud
 
Form helpers
Form helpersForm helpers
Form helpers
Blazing Cloud
 
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Blazing Cloud
 
What you don't know (yet)
What you don't know (yet)What you don't know (yet)
What you don't know (yet)
Blazing Cloud
 
Introduction to Rails
Introduction to RailsIntroduction to Rails
Introduction to Rails
Blazing Cloud
 
ActiveRecord
ActiveRecordActiveRecord
ActiveRecord
Blazing Cloud
 
Ruby on Rails Class intro
Ruby on Rails Class introRuby on Rails Class intro
Ruby on Rails Class intro
Blazing Cloud
 
Ruby on rails toolbox
Ruby on rails toolboxRuby on rails toolbox
Ruby on rails toolbox
Blazing Cloud
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentBlazing Cloud
 

More from Blazing Cloud (20)

Rails ORM De-mystifying Active Record has_many
Rails ORM De-mystifying Active Record has_manyRails ORM De-mystifying Active Record has_many
Rails ORM De-mystifying Active Record has_many
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3
 
Rails Class Intro - 1
Rails Class Intro - 1 Rails Class Intro - 1
Rails Class Intro - 1
 
Your first rails app - 2
 Your first rails app - 2 Your first rails app - 2
Your first rails app - 2
 
RSpec Quick Reference
RSpec Quick ReferenceRSpec Quick Reference
RSpec Quick Reference
 
Extending rails
Extending railsExtending rails
Extending rails
 
2day Ruby Class Intro
2day Ruby Class Intro2day Ruby Class Intro
2day Ruby Class Intro
 
Mobile Lean UX
Mobile Lean UXMobile Lean UX
Mobile Lean UX
 
Form helpers
Form helpersForm helpers
Form helpers
 
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
 
What you don't know (yet)
What you don't know (yet)What you don't know (yet)
What you don't know (yet)
 
Introduction to Rails
Introduction to RailsIntroduction to Rails
Introduction to Rails
 
ActiveRecord
ActiveRecordActiveRecord
ActiveRecord
 
Ruby on Rails Class intro
Ruby on Rails Class introRuby on Rails Class intro
Ruby on Rails Class intro
 
Ruby on rails toolbox
Ruby on rails toolboxRuby on rails toolbox
Ruby on rails toolbox
 
Routes Controllers
Routes ControllersRoutes Controllers
Routes Controllers
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Active Record
Active RecordActive Record
Active Record
 
Enumerables
EnumerablesEnumerables
Enumerables
 
Reg EX
Reg EXReg EX
Reg EX
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Interactive Graphics w/ Javascript, HTML5 and CSS3

  • 1. Interactive Graphics w/ Javascript, HTML5 and CSS3 Lee Lundrigan Sarah Allen
  • 2. Class Materials • You will want to get: • https://github.com/blazingcloud/ simple_animation • git@github.com:blazingcloud/ simple_animation.git
  • 3. Who are we? • Blazing Cloud, Inc. • Product Development Consultancy • Training • Lean Startup, Customer Development • Languages: HTML, CSS, Javascript, Ruby, Objective-C, Java
  • 4. Who are we? • Lee Lundrigan • iOS, Mac and Mobile Web specialist • Wrote a cross mobile browser CSS framework that ran on iPhone, Android, Blackberry and WinMo • Sarah Allen • 20 years of Product Experience • After Effects, Shockwave, Flash video, Open Laszlo, Lean Startup
  • 6. Tools of the trade • Oxygen XML Editor • http://www.oxygenxml.com • Aptana • http://www.aptana.com • TextEdit (on Mac) • TextPad (on Windows)
  • 7. Course Topics • Animation • 2D and 3D / HTML5 Canvas • Collision detection • Sprites • Sound • Interaction • Best practices
  • 8. Vocab vec·tor /ˈvektər/ Noun: A quantity having direction as well as magnitude, esp. as determining the position of one point in space relative to another. 10 15
  • 9. hertz (Hz) a unit of frequency of one cycle per second. Ex. 60Hz = 60 times per second ’tween/twēn/ Contraction: time between. The process of creating in between frames.
  • 10. Coordinate System • Cartesian Coordinate System • Starts in upper left • Origin is (0,0) 0 0
  • 11. Animation • setInterval(code,millisec); • repeats until cleared • setTimeout(code, millisec); • Fires the event once • Note: There are 1000 milliseconds in one second.
  • 13. Lab - Simple Animation
  • 14. Collision Detection • Bounding box • Test using object’s center • {x: 10, y: 10}
  • 15. Sound • HTML5 <embed> Tag <embed src="pong.mp3" id=”pong ”width=”0” height=”0” autostart=”false”/> • Get the object by id • Call the Play() method
  • 16. Keyboard Movement • document.onkeydown • detect character code • left: 37 right: 39 • set moving true • document.onkeyup • set moving false
  • 17. Keyboard Movement Cont... • Webkit based browsers have a bug • the keypress event doesn’t work for the arrow keys
  • 18. Lab - Game time

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n