Gil Megidish And I love writing / rewriting / reverse engineering games.

Slides:



Advertisements
Similar presentations
Build Amazing Apps with Web Standards Mobile HTML5 Applications In Hours, Not Days.
Advertisements

Visa-Valtteri visy Pimiä or how fumbling my way through pixel-based effects made learning WebGL a lot easier.
Bring Life to Your Web Pages with JavaScript and HTML5 Part 2 Ole Ildsgaard Hougaard -
Iframes & Images Using HTML.
2 History of World-Wide Web and HTML  1989: WWW has been invented at CERN  1991: Official birthday of HTML.
Introduction to HTML5 Programming donghao. HTML5 is the New HTML Standard New Elements, Attributes. Full CSS3 Support Video and Audio 2D/3D Graphics Local.
HTML5 Haptics Standardization
Understanding Mobile App Development Concepts and Working with APIs Lesson 6.
Using Bitmap graphics Having looked at vector graphics in the canvas, we will now look at using bitmap graphics.
HTML 5 Previous version: HTML4.01, 1999 Still work in progress, most browsers support some of it.
Bartosz Kowalski Software Developer CERN. Presentation outline -HTML : introduction and history -HTML5 : -History and philosophy -New features -Structure.
Chapter 15 HTML 5 Video and Audio Intro to HTML5 1.
Development of mobile applications using PhoneGap and HTML 5
Software and Multimedia
Text. Graphics Images – photos Animation Video Audio Text Copyright issues.
Web Design Basic Concepts.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
CPSC 594B: Software Engineering Project Lecture 1: Introduction to HTML5 Lecturer: Ayman Issa Office: ICT 555.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
HTML5 GAMING By Scott Benton. HTML5 New HTML Standard Previous Version of HTML, HTML 4.01, Released in 1999 Not an Official Standard Yet No Browsers Have.
CS7026 – HTML5 Canvas. What is the element 2  HTML5 defines the element as “a resolution-dependent bitmap canvas which can be used for rendering graphs,
IT Engineering I Instructor: Rezvan Shiravi
WebGL Patrick Cozzi University of Pennsylvania CIS Spring 2012.
Evaluation of HTML5 Graphics for Data Structure Visualization
Josh
Additional Topics. Tutorial #9 Review – Forms Forms Legend and fieldset Fields Text Password Radio buttons, check box, text area, select lists Buttons.
Mobile App Support Jacob Poirier Geri Hengesbach Andrea Menke Erin Rossell.
HTML, HTML5 Canvas, JavaScript PART 3 LOOKING MORE CLOSELY AT FULL BLOWN GAME DESIGN A PATTERNED BACKGROUND (CREATED WTIH LOOPS) WITH A MOVING OBJECT CHALLENGES.
Adobe FLASH What & Why? Where & When? Is Flash dead? What about HTML5?
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout HTML5 – Canvas.
Getting Started with Canvas IDIA Spring 2013 Bridget M. Blodgett.
Patrick Chanezon (slides from Matthew Papakipos) June Google’s HTML5 Work: What’s Next?
Session: 17. © Aptech Ltd. 2Canvas and JavaScript / Session 17  Describe Canvas in HTML5  Explain the procedure to draw lines  Explain the procedure.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
Class 02 – 03 Feb 2014 Setup Where do we begin? Know your content Discovering your target user.
1 Graphics CSCI 343, Fall 2015 Lecture 2 Introduction to HTML, JavaScript and WebGL.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Real-World Game Audio Development with HTML5 Craig Robinson, Absolute Hero Martin Reurings, Spil Games.
CS 174: Web Programming October 5 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
HTML5 AND THE FUTURE JAVASCRIPT PLATFORM Marcelo Lopez Ruiz Senior Software Design Engineer Microsoft Corporation.
CHAPTER 15 HTML 5 VIDEO AND AUDIO Intro to HTML5 1.
Types of Spatial Data Sites Data portals: Find and download data –Humboldt County, National Atlas “Atlases”: General information –GoogleMaps, MapQuest.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
HTML 5 Hands On By Rohit Ghatol
IE Developer Tools Jonathan Seitel Program Manager.
® ® copyright © 2013 Open Geospatial Consortium What HTML5 and REST mean to the Geo community Raj Singh, PhD Open Geospatial Consortium
What is HTML5? HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01, came in The web has changed a lot since then. HTML5.
Introduction of Presented by Neetu sharma MCA (8 th trim)
丁建文 國立高雄應用科大資管系副教授 兼任計網中心軟體發展組組長 跨平台行動應用軟體開發技術 : HTML5 & Mobile JavaScript Framework 暨南大學.
Martin Kruliš by Martin Kruliš (v1.1)1.
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
HTML5 ProgLan HTML5 Making a Game on the Canvas Part 1.
The HTML5 logo was introduced by W3C in 2010
That Gauge is COOL! 
Chapter 1 Introduction.
What is a Function Expression?
Egyptian Language School
Introducing OpenShot Library
Canvas Notes
Who Am I? appMobi's lead HTML5 game developer / evangelist
Types of Spatial Data Sites
Drawing Graphics in JavaScript
HTML5 – Canvas JavaScript Simple Drawing
Types of Spatial Data Sites
Types of Spatial Data Sites
Chapter 1 Introduction.
JavaScript – Let’s Draw!
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Gil Megidish

And I love writing / rewriting / reverse engineering games

Canvas Video Audio Web Sockets Web Storage Web Worker Web Database Selectors Validation File API Semantic Elements What The Heck is HTML5

Games + Javascript? = wtf

Why Bother With Javascript? Fun to develop –Hacker ’ s spielplatz! Fast deployment –Serve static files Easy to debug –alert(), firebug.. Still better than the alternative! Open source and free tools –Notepad, vi, emacs B.Y.O. framework –jQuery? spielplatz

But Why REALLY? Has been around for ages Won ’ t go away any time soon Wide support: –Web browsers –Mobile devices –Facebook applications –On a rocket near you

LOGIC GRAPHICS INPUT SOUND Anatomy of a Game MUSIC MULTIPLAYER GAME ASSETS

LOGIC GRAPHICS INPUT SOUND Anatomy of a Game MUSIC MULTIPLAYER GAME ASSETS javascript code onkeydown, onmousedown ajax, WebSocket Images, Audio, Video and Binary supported by browsers

Graphics

Framebuffer (raw) 0,00,10,20,30,40,50,60,70,x 1,01,11,21,31,41,51,61,71,x y,0y,1y,2y,3y,4y,5y,6y,7y,x x y … … …

Tile + Sprite Memory

Scene Graph Placeholder For Future Presentation

Canvas is King

DEMO TIME!

Three Demos To Rule Them All Framebuffer demo Sprites demo Vector graphics demo

Catch me a canvas Guru Meditation: No canvas supported! var canvas = document.getElementById(“graphics”); var context = canvas.getContext(“2d”);

Drawing Primitives ctx.fillStyle = “#c80000"; ctx.fillRect (10, 10, 55, 50); ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; ctx.fillRect (30, 30, 55, 50); Other drawing methods: arc, bezierCurve, lineTo, quadraticCurve, rect, stroke, fillText, strokeText, beginPath/closePath and fill

(but who needs that ?)

Drawing Images var sprite = new Image(); sprite.src = “ luigi.png ” ; var x = 0, y = 0; ctx.drawImage(sprite, x, y);

Drawing Images 2 var spritemap = new Image(); spritemap.src = “ sprite-map.png ” ; ctx.drawImage( spritemap, sx, sy, sw, sh, dx, dy, dw, dh ); Sprite maps save loading time by fewer requests and better compression. drawImage() also provides scaling and cropping.

Going Crazy With Images // context state checkpoint ctx.save(); ctx.translate(0, 80); ctx.rotate(-45 * Math.PI / 180.0); ctx.scale(3.0, 1.0); ctx.drawImage(luigi, 0, 0); // revert all context changes ctx.restore();

Accessing Pixels var block = ctx.getImageData(sx, sy, sw, sh); block = { width: width in pixels, height: height in pixels, data: array of 4*width*height bytes }; Alternatively: ctx.createImageData(w, h);

Accessing Pixels var block = ctx.getImageData(0, 0, canvas.width/2, canvas.height); for (var y=0; y<block.height; y++) { for (var x=0; x<block.width; x++) { block.data[(y*block.width+x)*4+0] ^= 0xff; block.data[(y*block.width+x)*4+1] ^= 0xff; block.data[(y*block.width+x)*4+2] ^= 0xff; } ctx.putImageData(block, 0, 0);

Why Access Pixels ? Complicated things impossible without putImageData() Read image pixels getImageData combined with primitive drawing = save image to disk! These examples are available to

The Jazz Singer

Let There Be Sound! $( “ sfx001 ” ).play();

Let There Be Sound! $( “ sfx001 ” ).play(); Other methods: $( “ sfx001 ” ).pause(); Other attributes: $( “ sfx001 ” ).currentTime = 35.0; $( “ sfx001 ” ).volume = 0.5; $( “ sfx001 ” ).duration (read only)

Putting It All Together

Typical Game Loop function gameTick() { processKeyboard(); moveEnemies(); drawGraphics(); updateAudio(); } var fps = 60; setInterval(gameTick, 1000 / fps);

The Future is Upon Us!

Quake2 HTML5

What ’ s Coming Up Next WebGL –OpenGL interface for Javascript –As of May, 2010: good luck finding a stable browser! WebSocket –UDP and nonblocking transport layer –Not there yet! (KAAZING?) WebStorage –Save games?

Code Like It ’ s 2020! ftw! ‘s‘s Blackberry coming June 1 st !

Q&A

Yes! You can use in Internet Explorer 6? PS. Remember to upgrade your mother ’ s IE!

Links! Chrome Experiments: Not Your Momma ’ s JS – Appcelerator ’ s Titanium – Box 2D: real time physics for JS games – Mozilla ’ s Canvas tutorial –

GO MAKE GAMES!