SlideShare uma empresa Scribd logo
1 de 54
GG Team Workshop GAMES & APPS IN JAVASCRIPT 2011 by Michal Budzynski
GG Team Workshop 2011 by Michal Budzynski Development of a game: ,[object Object]
Prototype
Alpha
Beta
RC
Gold Master
Localization
GG Team Workshop 2011 by Michal Budzynski
GG Team Workshop 2011 by Michal Budzynski DOM manipulation – direct appending ,[object Object]
Assembling them into DOM tree
Connecting created tree into main DOM structure
GG Team Workshop 2011 by Michal Budzynski DOM manipulation – direct appending
GG Team Workshop 2011 by Michal Budzynski DOM manipulation – document fragment ,[object Object]
Append all nodes & elements to it
Connecting documentFragment to the main DOM structure
GG Team Workshop DOM manipulation – document fragment
GG Team Workshop 2011 by Michal Budzynski Result:
GG Team Workshop 2011 by Michal Budzynski DOM manipulation – concatenation + innerHTML ,[object Object]
Put it directly into innerHTML of the parent node
Use methods like .childNodes() or .getElementsByTagName()
GG Team Workshop DOM manipulation – document fragment 2011 by Michal Budzynski
GG Team Workshop For single string using array buffer instead of += makes perfect sense – huge performance difference in older browsers and comparable results in newer ones. Doing join() on multiple arrays for concatenation is not a good idea. It takes way more time than simple +! http://kasia.drzyzga.pl/2011/04/never-concatenate-strings-with-really/ 2011 by Michal Budzynski
GG Team Workshop 2011 by Michal Budzynski
GG Team Workshop 2011 by Michal Budzynski
GG Team Workshop 2011 by Michal Budzynski Canvas API – 2d context ,[object Object]
.fillStyle = “”
.fillRect(a, b, c, d)
.moveTo(x, y)
.lineTo(x, y)
.bezierCurveTo()
.arc(x, y, radius, startAngle, endAngle, anticlockwise)
.stroke()
.fill()
GG Team Workshop 2011 by Michal Budzynski Canvas ,[object Object]
ctx.clearRect()
canvas.toDataURL();
GG Team Workshop 2011 by Michal Budzynski checker.draw('#f00') Result: checker.draw('#00f') Result:
GG Team Workshop 2011 by Michal Budzynski Result:
GG Team Workshop 2011 by Michal Budzynski Global variables and 'Namespace Pattern' ,[object Object]
More specific position of variable – better performance
GG Team Workshop 2011 by Michal Budzynski Global variables and 'Namespace Pattern' ,[object Object]
More specific position of variable – better performance
GG Team Workshop 2011 by Michal Budzynski Result:
GG Team Workshop 2011 by Michal Budzynski Events ,[object Object]
Events by attributes (DOM lvl 1)
Event Listeners (DOM lvl 2)
GG Team Workshop 2011 by Michal Budzynski Events ,[object Object]
Events by attributes (DOM lvl 1)
Event Listeners (DOM lvl 2)
Removing event-handlers
GG Team Workshop 2011 by Michal Budzynski Removing event handlers
GG Team Workshop 2011 by Michal Budzynski Removing event handlers
GG Team Workshop 2011 by Michal Budzynski Removing event handlers

Mais conteúdo relacionado

Mais procurados

Angular Illumination
Angular IlluminationAngular Illumination
Angular Illumination
Bryan Arbelo
 
DevChatt: The Wonderful World Of Html5
DevChatt: The Wonderful World Of Html5DevChatt: The Wonderful World Of Html5
DevChatt: The Wonderful World Of Html5
Cameron Kilgore
 

Mais procurados (8)

Untangling7
Untangling7Untangling7
Untangling7
 
Goobi overview
Goobi overviewGoobi overview
Goobi overview
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
HTML GL - возьмите столько FPS, сколько вам нужно!
HTML GL - возьмите столько FPS, сколько вам нужно!HTML GL - возьмите столько FPS, сколько вам нужно!
HTML GL - возьмите столько FPS, сколько вам нужно!
 
Angular Illumination
Angular IlluminationAngular Illumination
Angular Illumination
 
Building your actions for Google Assistant
Building your actions for Google AssistantBuilding your actions for Google Assistant
Building your actions for Google Assistant
 
Installing Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGLInstalling Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGL
 
DevChatt: The Wonderful World Of Html5
DevChatt: The Wonderful World Of Html5DevChatt: The Wonderful World Of Html5
DevChatt: The Wonderful World Of Html5
 

Semelhante a GG WORKSHOP GAMES & APPS IN JAVASCRIPT

CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
Ciklum Ukraine
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
Francesca Tosi
 
E-magazineDecember_sample
E-magazineDecember_sampleE-magazineDecember_sample
E-magazineDecember_sample
tutorialsruby
 
E-magazineDecember_sample
E-magazineDecember_sampleE-magazineDecember_sample
E-magazineDecember_sample
tutorialsruby
 
Getting more out of Matplotlib with GR
Getting more out of Matplotlib with GRGetting more out of Matplotlib with GR
Getting more out of Matplotlib with GR
Josef Heinen
 
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA KramerLook Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
mfrancis
 

Semelhante a GG WORKSHOP GAMES & APPS IN JAVASCRIPT (20)

TechEvent BASTA von WPF nach Angular in 60 Minuten
TechEvent BASTA von WPF nach Angular in 60 MinutenTechEvent BASTA von WPF nach Angular in 60 Minuten
TechEvent BASTA von WPF nach Angular in 60 Minuten
 
German introduction to sp framework
German   introduction to sp frameworkGerman   introduction to sp framework
German introduction to sp framework
 
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
 
TechEvent Advanced Service Worker / PWA with Google Workbox
TechEvent Advanced Service Worker / PWA with Google WorkboxTechEvent Advanced Service Worker / PWA with Google Workbox
TechEvent Advanced Service Worker / PWA with Google Workbox
 
Pro Agile .NET Development Solution Overview
Pro Agile .NET Development Solution OverviewPro Agile .NET Development Solution Overview
Pro Agile .NET Development Solution Overview
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
E-magazineDecember_sample
E-magazineDecember_sampleE-magazineDecember_sample
E-magazineDecember_sample
 
E-magazineDecember_sample
E-magazineDecember_sampleE-magazineDecember_sample
E-magazineDecember_sample
 
Getting more out of Matplotlib with GR
Getting more out of Matplotlib with GRGetting more out of Matplotlib with GR
Getting more out of Matplotlib with GR
 
Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Using WordPress as a Headless CMS with WPGraphQL
Using WordPress as a Headless CMS with WPGraphQLUsing WordPress as a Headless CMS with WPGraphQL
Using WordPress as a Headless CMS with WPGraphQL
 
Untangle Your Front End Development with Visual Studio 2015
Untangle Your Front End Development with Visual Studio 2015Untangle Your Front End Development with Visual Studio 2015
Untangle Your Front End Development with Visual Studio 2015
 
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA KramerLook Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
Look Inside Your OSGi Bundles and Build them Block by Block - FA Kramer
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

GG WORKSHOP GAMES & APPS IN JAVASCRIPT