Difference between revisions of "Processingjs gamepaper"

From CDOT Wiki
Jump to: navigation, search
(Introduction)
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=First Draft=
+
=Any further edits should be made in this section or mentioned to Cathy or Daniel. formatting this into ACM now=
 +
 
 +
add changes here or contact cathy or daniel
 +
 
 +
=Processing.js for Web based Games=
  
 
==Introduction==
 
==Introduction==
  
Game delivery in a webpage typically requires some sort of browser plug-in. However due to security concerns and general wariness about plug-ins, delivering content/games that require a plugin may be a barrier to access for some users.  Furthermore there are some platforms where a plug-in does not exist or cannot exist(be installed?), such as in the mobile environment. Even Flash, which is one of the most ubiquitous visual interactive environments, is not available on every platform. The only real solution to web delivery of rich graphics in an interactive environment(?)/webpage is to be integrated into native browser technology.
+
Games delivery require fast, highly graphical, interactive, multimedia environments. To accomplish this, games delivered on a web page, have traditionally required some sort of browser plug-in. However due to security concerns and general wariness about plug-ins, delivering content/games in this manner is a barrier to access for some users.  Furthermore, browser plug-ins are not available on browsers for all platforms. Even Flash, which is one of the most ubiquitous visual interactive environments, is not available for every browser. The HTML5 <canvas> element, standardized in ...(find citation) allows the programmatic delivery of graphics on a web page without plug-ins.  With its inclusion in the soon to be released IE 9, the <canvas> element now represents a means to deliver rich graphical content in all the major browsers.  
  
''
+
The typical way to draw on the canvas is to use JavaScript.  However for artists, educators, and other people less familiar with JavaScript, learning to do this can be a barrier to entry.  The Processing language introduced by Ben Fry and Casey Reas is a simple and elegant language for data visualization that is already used by artists, educators, and commercial media to deliver rich graphical content called sketches.  There is a large body of work around the world which is being developed using Processing. However, Processing is developed in Java and thus delivering Processing sketches on a web page requires that the user install a Java plugin. Furthermore the sketches themselves are self contained items as opposed to being part of a web page.  While it is possible to deliver a sketch via a Java applet, the web page serves as a medium of delivery as opposed to being part of the game.
[?Placement of this paragraph? DM'']
 
The HTML <canvas> element allows the programmatic delivery of graphics in a web page without plugins.  With its inclusion in the soon to be released IE 9, the <canvas> element now represents a means to deliver graphical content in all the major browsers.  The typical way to interact with the canvas is to use JavaScript.  However for artists, educators, and other people less familiar with JavaScript, learning to do this can be a barrier to entry.
 
  
 +
Processing.js is an open source, cross browser JavaScript port of the Processing language.  It uses the canvas element for rendering and does not require any plug-ins.  However, Processing.js is more than just a Processing parser written in JavaScript.  It also enables the embedding of other web technologies into Processing sketches and vice versa.  This extension allows not only the rendering of sketches without the use of plug-ins but also the ability for a Processing sketch to make use of web technologies to create games.  Processing.js seamlessly integrates web technologies with the processing language to provide a framework for multimedia web games.
  
The Processing language introduced by Ben Fry and Casey Reas is a simple and elegant language for data visualization that is already used by artists, educators as well as commercial media to deliver rich graphical content called sketches.  There is a large body of work around the world which is being developed using Processing. However, Processing was developed in Java and thus delivering Processing sketches on a webpage required that the user install a Java plugin. Furthermore the sketches themselves are self contained items as opposed to being part of a web page.  That is, the elements of the Document Object Model (DOM) of a webpage can not interact with it or vice versa. Thus, while it is possible to deliver visual content it would be difficult to create Processing sketches to take full advantage of modern web services such as flickr, twitter etc.
+
==Background==
  
  
 +
The Processing.js project was started by John Resig who wanted to utilize the HTML5 canvas element and take advantage of the Java Processing language. It took about seven months to get a working version, consisting of 5000 lines of code but it was not a complete port of the Processing language (source?). The project, similarly to other open source products, was released with the hope that a developer community would converge around it and contribute to development. In September 2009, students from Seneca College began the work to complete Processing.js.  In order to facilitate an architecture for participation the source code had to be readily available and the inner workings of the project and the missing functionality must be publicized.  To this end the source code was made available publicly on GitHub and an issue tracking system was used to manage the large number of issues needed to be resolved in order to complete the port.  A review process was setup to ensure that the code submitted was of sufficient quality.  Processing.js 1.0 was released in November 2010.
  
Processing.js is an open source, cross browser JavaScript port of the Processing language.  It uses the canvas element for rendering and does not require any plug-ins.  However, Processing.js is more than just a Processing parser written in JavaScript.  It also enables the embedding of other web technologies into Processing sketches.  This extension will allow for a new set of visualizations previously not possible.  Processing.js seamlessly integrates web technologies with the processing language to provide a framework for multimedia web applications.
+
==Processing.js in detail==
  
==Background==
+
The original Processing Language is written in Java and the syntax is Java based.  Sketches written in Processing can be compiled into standalone applications or Java Applets.  Processing.js interprets Processing sketches and creates JavaScript code that renders on a web page.  When the original Processing Language, was first developed, Java was supposed to become the language of the web while JavaScript was a client-side scripting language for small tasks. As the web matured, JavaScript, however, became the language of the web, although many of the misconceptions about it still persist. (cite JavaScript the good parts here)  With recent developments in JavaScript technology, JavaScript is now fast enough to handle the demands of real-time interactive multimedia web applications such as games.
  
The processing.js project was started by John Resig who wanted to utilize the HTML5 canvas element and take advantage of the Java Processing language. It took about seven months to get a working version, consisting of 5000 lines of code but it was not a complete port of the Processing language. The project, similarly to other open source products, was released with the hope that a developer community will converge around it and contribute to development. In September 2009, we began the work to complete the port to JavaScript.   In order to facilitate an architecture for participation the source code had to be readily available and the inner workings of the project and the missing functionality must be publicizedTo this end the source code was made available publicly on GitHub and an issue tracking system was used to manage the large number of issues needed to be resolved in order to complete the portA review process was setup to ensure that the code submitted was of sufficient quality.
+
From it's inception, Processing.js was designed to be more than just a rewrite of the Java functions provided by Processing to JavaScript. John Resig wrote the original Processing.js parser to scan a Processing sketch for hints of Java code and translate that code to JavaScript. However, if the parser encountered JavaScript code, it would leave the code intact as JavaScript. This method allows not only for the interpretation of existing Processing code but also the injection of JavaScript into Processing sketchesJavaScript code can exist inside a Processing sketch without any need to declare the language you are usingOld sketches written for Processing will work but new sketches written for Processing.js can easily make use of common web libraries such as JQuery or pull in resources from web services such as Twitter, Google maps, or Flickr.
  
From it's inception, Processing.js was designed to be more than just a rewrite of the Java functions provided by Processing to JavaScript.  John Resig wrote the original Processing.js parser to scan a Processing sketch for hints of Java code and convert that code to JavaScriptHowever, if the parser encountered JavaScript code, it would leave the code intactThis method allowed not only for the conversion of existing Processing code to JavaScript but the injection of JavaScript into Processing sketches as well. By allowing JavaScript to exist within a Processing Sketch intact,Java and JavaScript code can exist together without any need to declare the language you are using.  Old sketches written for Processing will work but new sketches written for Processing.js can not only have Processing code but can make use of JavaScript to interact with other elements of the webpage.
+
While JavaScript and Java are fairly similar syntactically, there are some fundamental differences that has made this conversion challenging. The first is that we wanted to do this conversion dynamically when a web page is loaded. The code produced by Processing.js needed to be fully object oriented and we had to provide support to all native Java functions and objects that are supported by ProcessingWe also had to take into account the differences between working with web resources vs local resourcesFurthermore we had to consider how we would handle some fundamental differences between Java and JavaScript such as typed vs. typeless variables, function overloading and variable name overloading.
  
==JavaScript==
+
The original code for Processing.js used regular expressions to convert Java into JavaScript when it was encountered.  It did this by scanning for hints of Java code within the entire sketch and then replaced the Java code with its JavaScript equivalent.  Due to the difference in how Java and JavaScript accessed object properties from methods inside an object, the with statement was used as a simple solution to avoid having to prepend all function calls with "this." or "Processing.".  However, the use of the with statement also meant that the JavaScript generated would fall off Trace (cite trace paper here... do we need to talk about trace in the back ground section???) making the code run slower than it needed to in some browsers.  In later versions of Processing.js this method of scanning the entire sketch was replaced by the creation of an abstract syntax tree that broke up the sketch into smaller pieces.  Each piece was then interpreted separately.  This change made the interpretation of the sketch far cleaner.
  
When the original Processing Language, also known as P5, was first developed, Java was supposed to become the language of the web while JavaScript was client-side scripting language for small tasks. As the web matured, JavaScript, however, became the language of the web, although many of the misconceptions about it still persist. /*cite javascript the good parts here*/  With recent developments in JavaScript technology, JavaScript is now fast enough to handle the demands of realtime interactive web graphics.
+
==The Blending of the Web==
  
Processing.js is more than just a Processing parser re-written in JavaScript. It is designed in a way that connects the Processing language (also known as P5) with web technologies such as JavaScript, the HTML5 canvas element, JQuery, and various web services/*Awkward*/ Furthermore, Processing.js is built in such a way as to allow easy integration of new technologies as they emergeIt is designed to be fast and to take advantage of recent JavaScript developments to ensure that the platform is responsive.
+
One of the most powerful features of Processsing.js is its ability to blend JavaScript code with Processing codeThis results of this blending means that Processing sketches are not simply delivered in a self contained container but can make use of and interact with other elements of the webThis section looks at examples of such blending.
  
While JavaScript and Java are fairly similar syntactically, there are some fundamental differences that has made this conversion challenging.  The first is that we wanted to do this conversion dynamically in real time.  The code produced by the converter??? needed to be fully object oriented and we had to provide support to all native Java functions and objects that are supported by Processing.  We also had to take into account the differences between working with web resources vs local resources.  Furthermore we had to consider how we would handle some fundamental differences between Java and JavaScript such as typed vs. typeless variables, function overloading and variable name overloading.
+
/* insert descriptions and screenshots of applications for demo reel here*/
 
 
The original code for Processing.js used regular expressions to convert Java into JavaScript when it was encountered.  It did this by scanning for hints of Java code within the entire sketch and then replaced the Java code with its JavaScript equivalent.  Due to the difference in how Java and JavaScript accessed object properties from methods inside an object, the with statement was used as a simple solution to avoid having to prepend all function calls with "this." or "Processing.".  However, the use of the with statement also meant that the JavaScript generated would fall off Trace /*cite trace paper here... do we need to talk about trace in the back ground section???*/ making the code run slower than it needed to in some browsers.  Later this method of scanning the entire sketch was replaced by the creation of an abstract syntax tree that broke up the code into smaller pieces.  Each piece then had the regular expressions applied to change it.  This made it was easier to apply the regular expressions correctly without accidentally converting code that was already working.  It also made it easier to create proper inheritance structures and attach properties and methods to the correct object in the hierarchy chain as smaller pieces of code was being converted at any one time.
 
  
 
==Browser Unification==
 
==Browser Unification==
  
One important feature provided by Processing.js is that it hides the differences between browsers.  Web standards are often loosely defined, and thus variations can exist. These variations not only exist between different browser vendors but can even exist between versions of the same browser on different platforms. Something as simple as key events can vary widely between browsers. Processing.js hides a large number of these differences from the user by creating a unified method of handling events.  Regardless of the browser/platform, the functions for handling events within Processing.js are handled the same way.
+
One important feature provided by Processing.js is that it hides the differences between browsers.  Web standards are often loosely defined, and thus variations can exist. These variations not only exist between different browser vendors but can even exist between versions of the same browser on different platforms. Something as simple as key events can vary widely between browsers. When creating content as interactive as games in the web, these small differences can create huge problems for the content creators.
  
Different browser makers are also at various stages of implementation for various newer technologies.  For example, WebGL provides typed arrays which are much faster than traditional JavaScript arrays.  While these typed arrays are implemented for WebGL, they can be used outside of that context also and can provide tremendous speed improvementHowever, not every browser supports WebGL at this time thus a fallback to regular JavaScript arrays is necessary if the feature does not exist.
+
Processing.js hides a large number of these differences from the user by creating a unified method of handling common interactive eventsRegardless of the browser/platform, the functions behavior of the event handlers are the same in different browsers. This standardization makes Processing.js an ideal candidate for game developers to develop games without worrying about how the controls will differ between browsers.
 
 
By hiding these differences between browser makers from the user, Processing.js provides a means for game developers to make games without worry about the differences between browsers.  If a feature exists that can make the rendering smoother and faster, Processing.js will make use of it to increase performance.  If it does not exist a fallback mechanism is available to allow it to still run.
 
  
 
==3D support==
 
==3D support==
  
The introduction of the <canvas> tag into the HTML5 specification allowed Processing to be ported to JavaScript, thus enabling users to run 2D sketches within the browser without additional plug-ins. At the time when porting began, there was no plug-in free method of delivering 3D content. This limited Processing.js to its 2D functions.  WebGL, A JavaScript API that is based on OpenGL ES 2.0, is now being implemented by Firefox, Chrome and Safari. It is has become a viable candidate for use in Processing.js to render 3D sketches. Additionally, since WebGL closely matches OpenGL which is used by Processing, the porting of the 3D Processing functions was relatively straight forward.
+
The introduction of the <canvas> element into the HTML5 specification allowed Processing to be ported to JavaScript.  This enables users to run 2D Processing sketches within the browser without additional plug-ins. At the time the Processing.js project began, there was no plug-in free method of delivering 3D content. This limited Processing.js to its 2D functions.  WebGL, a JavaScript API that is based on OpenGL ES 2.0, is now being implemented by Firefox, Chrome and Safari. Processing.js 1.0 makes use of WebGL to support its 3D functions.
  
===Differences between OpenGL and WebGL===
+
The matter of porting 3D Processing to Processing.js was simplified because Processing uses OpenGL for 3D graphics. The single largest difference between WebGL and the OpenGL library used in Processing is that in WebGL, the fixed-function pipeline has been removed. Because of this, user-defined vertex and fragment shaders are necessary for lighting operations. Since some shapes in Processing aren't lit and others were, multiple shaders have been written. One shader exists for lit objects such as boxes and spheres, another less complex shader was written for unlit objects such as lines and points.
The matter of porting Processing (which uses OpenGL /*1.x?? if it was opengl 2.0 it would have been even easier right?*/) was simplified because the WebGL interface is similar that of OpenGL, but there are a number of differences between the interfaces. The single largest difference between WebGL and OpenGL 1.x is that like OpenGL ES 2.0, the fixed-function pipeline was been removed. Because of this, user-defined vertex and fragment shaders were necessary for lighting operations. Since some shapes in Processing aren't lit and others were, multiple shaders were written. One shader exists for lit objects such as boxes and spheres, another less complex shader was written for unlit objects such as lines and points.
 
  
The following shaders are used for rendering unlit shapes specified with begin/end function calls.
+
/* shaders to go in a figure on final paper*/
  
 
<pre>
 
<pre>
Line 70: Line 69:
 
</pre>
 
</pre>
  
===Typed Arrays===
+
==Conclusion==
Performance is always a concern when rendering 3D content, so it was necessary to create a faster version of JavaScript'script's inherently slow arrays types. Because of this, typed arrays were incorporated into pre-release versions of WebGL browsers. Unlike regular arrays which can contain different types such as strings, numbers and objects, typed arrays can only contain one type and cannot by dynamically resized. Some of these types include Float32Intay, Int32Uinty, Uint16ArrUintnd Uint8Array. These types provide a significant performance increase when manipulating arrays.
 
 
 
(table removed)
 
<table border="1">
 
<tr>
 
<td>Operation</td>
 
<td>Array</td>
 
<td>Float32Array</td>
 
</tr>
 
 
 
<tr>
 
<td>Write</td>
 
<td>8947</td>
 
<td>1455</td>
 
</tr>
 
 
 
<tr>
 
<td>Read</td>
 
<td>1948</td>
 
<td>1109</td>
 
</tr>
 
  
<tr>
+
Processing.js seamlessly integrates elements of a webpage to create a viable platform for games on the web. It handles events in a consistent manner between different browsers, making it easier for game developers to create content with it. Furthermore the interpreter was written efficiently. Today's JavaScript engines are highly efficient. This efficiency means that interactive applications such as games can be written in JavaScript. Processing.js makes this process smoother.
<td>Loop-copy</td>
 
<td>&gt;10, 000</td>
 
<td>1969</td>
 
</tr>
 
 
 
<tr>
 
<td>Slice-Copy</td>
 
<td>1125</td>
 
<td>503</td>
 
</tr>
 
 
 
</table>
 
 
 
Win7 64Bit, 4GB Ram, Dual-Core 1.30Ghz Intel U7300
 
(citation needed)
 
 
 
Alistair MacDonald
 
 
 
[http://weblog.bocoup.com/javascript-typed-arrays link]
 
 
 
Because typed arrays are only available for pre-release browsers, they cannot currently be used in 2D sketches. Once they become implemented in browsers, a significant amount of the Processing.js code base can make use of these structures, increasing performance throughout the library.... /* andor, mike said its in... is it???*/
 
 
 
==Conclusion==
 
  
 
==References==
 
==References==

Latest revision as of 13:20, 16 January 2011

Any further edits should be made in this section or mentioned to Cathy or Daniel. formatting this into ACM now

add changes here or contact cathy or daniel

Processing.js for Web based Games

Introduction

Games delivery require fast, highly graphical, interactive, multimedia environments. To accomplish this, games delivered on a web page, have traditionally required some sort of browser plug-in. However due to security concerns and general wariness about plug-ins, delivering content/games in this manner is a barrier to access for some users. Furthermore, browser plug-ins are not available on browsers for all platforms. Even Flash, which is one of the most ubiquitous visual interactive environments, is not available for every browser. The HTML5 <canvas> element, standardized in ...(find citation) allows the programmatic delivery of graphics on a web page without plug-ins. With its inclusion in the soon to be released IE 9, the <canvas> element now represents a means to deliver rich graphical content in all the major browsers.

The typical way to draw on the canvas is to use JavaScript. However for artists, educators, and other people less familiar with JavaScript, learning to do this can be a barrier to entry. The Processing language introduced by Ben Fry and Casey Reas is a simple and elegant language for data visualization that is already used by artists, educators, and commercial media to deliver rich graphical content called sketches. There is a large body of work around the world which is being developed using Processing. However, Processing is developed in Java and thus delivering Processing sketches on a web page requires that the user install a Java plugin. Furthermore the sketches themselves are self contained items as opposed to being part of a web page. While it is possible to deliver a sketch via a Java applet, the web page serves as a medium of delivery as opposed to being part of the game.

Processing.js is an open source, cross browser JavaScript port of the Processing language. It uses the canvas element for rendering and does not require any plug-ins. However, Processing.js is more than just a Processing parser written in JavaScript. It also enables the embedding of other web technologies into Processing sketches and vice versa. This extension allows not only the rendering of sketches without the use of plug-ins but also the ability for a Processing sketch to make use of web technologies to create games. Processing.js seamlessly integrates web technologies with the processing language to provide a framework for multimedia web games.

Background

The Processing.js project was started by John Resig who wanted to utilize the HTML5 canvas element and take advantage of the Java Processing language. It took about seven months to get a working version, consisting of 5000 lines of code but it was not a complete port of the Processing language (source?). The project, similarly to other open source products, was released with the hope that a developer community would converge around it and contribute to development. In September 2009, students from Seneca College began the work to complete Processing.js. In order to facilitate an architecture for participation the source code had to be readily available and the inner workings of the project and the missing functionality must be publicized. To this end the source code was made available publicly on GitHub and an issue tracking system was used to manage the large number of issues needed to be resolved in order to complete the port. A review process was setup to ensure that the code submitted was of sufficient quality. Processing.js 1.0 was released in November 2010.

Processing.js in detail

The original Processing Language is written in Java and the syntax is Java based. Sketches written in Processing can be compiled into standalone applications or Java Applets. Processing.js interprets Processing sketches and creates JavaScript code that renders on a web page. When the original Processing Language, was first developed, Java was supposed to become the language of the web while JavaScript was a client-side scripting language for small tasks. As the web matured, JavaScript, however, became the language of the web, although many of the misconceptions about it still persist. (cite JavaScript the good parts here) With recent developments in JavaScript technology, JavaScript is now fast enough to handle the demands of real-time interactive multimedia web applications such as games.

From it's inception, Processing.js was designed to be more than just a rewrite of the Java functions provided by Processing to JavaScript. John Resig wrote the original Processing.js parser to scan a Processing sketch for hints of Java code and translate that code to JavaScript. However, if the parser encountered JavaScript code, it would leave the code intact as JavaScript. This method allows not only for the interpretation of existing Processing code but also the injection of JavaScript into Processing sketches. JavaScript code can exist inside a Processing sketch without any need to declare the language you are using. Old sketches written for Processing will work but new sketches written for Processing.js can easily make use of common web libraries such as JQuery or pull in resources from web services such as Twitter, Google maps, or Flickr.

While JavaScript and Java are fairly similar syntactically, there are some fundamental differences that has made this conversion challenging. The first is that we wanted to do this conversion dynamically when a web page is loaded. The code produced by Processing.js needed to be fully object oriented and we had to provide support to all native Java functions and objects that are supported by Processing. We also had to take into account the differences between working with web resources vs local resources. Furthermore we had to consider how we would handle some fundamental differences between Java and JavaScript such as typed vs. typeless variables, function overloading and variable name overloading.

The original code for Processing.js used regular expressions to convert Java into JavaScript when it was encountered. It did this by scanning for hints of Java code within the entire sketch and then replaced the Java code with its JavaScript equivalent. Due to the difference in how Java and JavaScript accessed object properties from methods inside an object, the with statement was used as a simple solution to avoid having to prepend all function calls with "this." or "Processing.". However, the use of the with statement also meant that the JavaScript generated would fall off Trace (cite trace paper here... do we need to talk about trace in the back ground section???) making the code run slower than it needed to in some browsers. In later versions of Processing.js this method of scanning the entire sketch was replaced by the creation of an abstract syntax tree that broke up the sketch into smaller pieces. Each piece was then interpreted separately. This change made the interpretation of the sketch far cleaner.

The Blending of the Web

One of the most powerful features of Processsing.js is its ability to blend JavaScript code with Processing code. This results of this blending means that Processing sketches are not simply delivered in a self contained container but can make use of and interact with other elements of the web. This section looks at examples of such blending.

/* insert descriptions and screenshots of applications for demo reel here*/

Browser Unification

One important feature provided by Processing.js is that it hides the differences between browsers. Web standards are often loosely defined, and thus variations can exist. These variations not only exist between different browser vendors but can even exist between versions of the same browser on different platforms. Something as simple as key events can vary widely between browsers. When creating content as interactive as games in the web, these small differences can create huge problems for the content creators.

Processing.js hides a large number of these differences from the user by creating a unified method of handling common interactive events. Regardless of the browser/platform, the functions behavior of the event handlers are the same in different browsers. This standardization makes Processing.js an ideal candidate for game developers to develop games without worrying about how the controls will differ between browsers.

3D support

The introduction of the <canvas> element into the HTML5 specification allowed Processing to be ported to JavaScript. This enables users to run 2D Processing sketches within the browser without additional plug-ins. At the time the Processing.js project began, there was no plug-in free method of delivering 3D content. This limited Processing.js to its 2D functions. WebGL, a JavaScript API that is based on OpenGL ES 2.0, is now being implemented by Firefox, Chrome and Safari. Processing.js 1.0 makes use of WebGL to support its 3D functions.

The matter of porting 3D Processing to Processing.js was simplified because Processing uses OpenGL for 3D graphics. The single largest difference between WebGL and the OpenGL library used in Processing is that in WebGL, the fixed-function pipeline has been removed. Because of this, user-defined vertex and fragment shaders are necessary for lighting operations. Since some shapes in Processing aren't lit and others were, multiple shaders have been written. One shader exists for lit objects such as boxes and spheres, another less complex shader was written for unlit objects such as lines and points.

/* shaders to go in a figure on final paper*/

"varying vec4 vFrontColor;" +
"attribute vec3 aVertex;" +
"attribute vec4 aColor;" +
"uniform mat4 uView;" +
"uniform mat4 uProjection;" +
"void main(void) {" +
"  frontColor = aColor;" +
"  gl_Position = uProjection * uView * vec4(aVertex, 1.0);" +

"}";

fragment shader:

ifdef"GLfESf GL_ES\n" +
"prehighpn highp float;\n" endif"#endif\n" +

"vvecinvFrontColorntColor;" +
"void main(void){" +glrFragColoragCvFrontColorntColor;" +
"}";

Conclusion

Processing.js seamlessly integrates elements of a webpage to create a viable platform for games on the web. It handles events in a consistent manner between different browsers, making it easier for game developers to create content with it. Furthermore the interpreter was written efficiently. Today's JavaScript engines are highly efficient. This efficiency means that interactive applications such as games can be written in JavaScript. Processing.js makes this process smoother.

References