I just came across
this
It looks pretty awesome so i of course went right click a开发者_运维知识库nd inspect element but all i saw was a bunch ofscript
tags and one single canvas
tag with text saying "This game is built for Google Chrome".
Why can't i see what is happening in the html? and do you have a rough idea of how they built this?
This is built using the Canvas html element which just a bitmap with immediate mode drawing. There are no DOM elements in their to inspect just pixels.
Their code (like video games) will have some sort of loop that will draw new frames to the canvas.
They are using Canvas: "is a new HTML element which can be used to draw graphics using scripting". An excellent tutorial on canvas can be found on the Mozilla developer pages: https://developer.mozilla.org/en/canvas_tutorial
精彩评论