Lesson 5, HTML5 Canvas Using Sprite 2D
Lesson 5, HTML5 Canvas Using Sprite 2D
Benefits of HTML5
HTML5 – Canvas allows for dynamic, scriptable rendering of 2D shapes and bitmap
images.
HTML canvas is a way to create illustrations and graphics using HTML and JavaScript.
A canvas is created in HTML with the <canvas> element. Canvas illustrations can also
move and can be made interactive, making them great for infographics, data
visualizations, animations, and even simple games.
Canvas element syntax
You can easily find that <canvas> element in the DOM (document object model)using getElementById()
method as follows −
Page 1 of 5
Page 2 of 5
Context variable: A variable which can be set either at compile time or runtime. It can
be changed and allows variables which would otherwise be hardcoded to be more
dynamic.
Page 3 of 5
HTML5 Canvas Tutorial for Complete Beginners
https://www.youtube.com/watch?v=EO6OkltgudE
https://blog.hubspot.com/website/html-canvas
https://www.youtube.com/watch?v=HpcWwopnnQE&t=4737s
00:40
Editor
04:55
21:57
Page 4 of 5
Fill of the Rectangle
26:02
50:37
Event Listeners
01:02:10
01:29:59
Random Calculations
01:37:27
Collision
01:55:07
Collision Detection
02:16:10
Source Code
Page 5 of 5