Games development on Smart TV

We talk about JavaScript. Each month in Warsaw, Poland.

Games development on Smart TV

Kamil Kiełbasa @blackdante90

Agenda:

What is Canvas?

Canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap and does not have a built-in scene graph.

Usage of Canvas.

		// html
                <canvas id="example" width="200" height="200"></canvas>
		// javascript
                var example = document.getElementById('example');
                var context = example.getContext('2d');
		context.fillStyle = "rgb(255,0,0)";
		context.fillRect(30, 30, 50, 50);
            

What is WebGL?

WebGL (Web Graphics Library) is a JavaScript API for rendering interactive 3D graphics and 2D graphics within any compatible web browser without the use of plug-ins. WebGL is integrated completely into all the web standards of the browser allowing GPU accelerated usage of physics and image processing and effects as part of the web page canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.

History of WebGL

Everything we need to build a game.

                init();
                animate();
                
		function init() {
		// game bootstrap
		}
                function animate() {
		    requestAnimationFrame( animate );
		    // game update 
		}
            

Graphics.

We have audio tag in HTML 5!

                <audio controls>
                    <source src="Horse.ogg" type="audio/ogg">
                    <source src="Horse.mp3" type="audio/mpeg">
		</audio>
            

Storage is also in HTML 5!

		// getting from storage.
                var foo = localStorage.getItem("bar");
		// save to storage.
                localStorage.setItem("bar", foo);
            

emm... Events?

                el.addEventListener("click", function () { 
		   // some actions.
                });
            

Internet Connection.

Games on Browser.

TV and Games?

Browser vs Smart TV.

Browser advantages:

Browser vs Smart TV.

Smart TV advantages:

Why not TV and mobile Games?

Support of HTML 5 in Smart TV.

See you next month at WarsawJS

Fork me on Github