Open main menu

CDOT Wiki β

Changes

FSOSS 2010/processing.js/

1,892 bytes added, 08:29, 28 October 2010
no edit summary
<h3b>Welcome to the Game Development Using Processing.jsWorkshop!</h3b>
<b>==Intro (me)</b><br />==
<ul>
<li>Seneca college BSD student</li>
<b>==Goals</b><br />& Schedule==<ul> <li>Develop a simple 2D or 3D game using in Processing</li> <li>9-11 Examples and exercises</li> <li>11-12 Work, experiment, collaborate</li></ul>
<b>==Processing (aka P5)</b> [http://www.Processing.org Processing.org]<br />==
<ul>
<li>[http://www.Processing.org Processing.org]</li>
<li>Open source data visualization language</li>
<li>Developed in Java</li>
<li>"Sketches" written using Java syntax in the [http://www.processing.org/download/ PDE]</li>
<li>Requires a JVM plug-in</li>
<li>Uses the <object> tag</li>
<li>[http://www.processing.org/reference/ Reference]</li>
<li>[http://code.google.com/p/processing/issues/list Bug tracking]</li>
</ul>
===Setting up Processing===<bul>Processing.js (aka PJS) </bli> Download it [http://www.ProcessingJSprocessing.org ProcessingJS/download/ here]</li> <li>Save the .org]DMG file to the Desktop</li> <li>Double-click to extract file</li> <li>Drag the Processing icon to the desktop</li> <li>Double-click the icon to start</li><br /ul>  ==Processing.js (aka PJS)==
<ul>
<li>[http://www.ProcessingJS.org ProcessingJS.org]</li>
<li>Open source JavaScript port of Processing</li>
<li>Started by John Resig</li>
<li>Many contributions by Seneca</li>
<li>[http://processing-js.lighthouseapp.com/ Bug Tracking]</li>
<li>Does not require a plug-in</li>
<li>Uses the <canvas> tag</li>
<li>Lots of IDEs [http://processingjs.org/learning/ide Processing.js IDE], [http://hascanvas.com/ HasCanvas], [http://sketchpad.cc/ SketchPad], [http://sketch.processing.org/ Sketch.Processing.org], [http://matrix.senecac.on.ca/~asalga/pjswebide/ My IDE]</li>
</ul>
==Setting up Minefield== <ul> <li>Why use it?</li> <li>Much faster than Firefox</li> <li>Has WebGL</li> <li>Download a working version of Minefield [http://zenit.senecac.on.ca/wiki/index.php/Level_Up:_An_OpenWeb_Game_Jam#Resources here]<b/li>Setting up Processing <li>Instructions to enabled WebGL [http://www.c3dl.org/index.jsphp/tutorials/tutorial-1-browsers/ here]</bli> <br /ul>  ==Setting up Processing.js==
<ul>
<li>3 Files Required</li>
<b>Coordinate system</b><br />==Examples & Exercises== <ul>===Basics=== <li>size() sets canvas dimensions<, background, rect [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/li>example1 Example]  <li> top-left corner setup [0, 0http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example2 Example]</li>  <li> X increases right<draw, noStroke, ellipse, fill, mousePressed [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/li>processing.js/example3 Example]  <li> Y increases downwards<line, stroke, strokeWeight [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/li> <processing.js/ul>example4 Example]
ArrayList [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example5 Example]
<b>Basiscs</b>===Input=== 1 - sizemousePressed, mouseReleased, backgroundprintln, rect debugging with P5 [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example1 example6 Example]
2 - setup keyPressed, keyCode, keyReleased [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example2 example9 Example]
3 - draw, noStroke, ellipse, fill, mousePressed [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example3 Example]
===Text & Random=== 4 - linetext, stroke, strokeWeight random [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example4 randomText Example]
5 - ArrayList [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example5 ExamplerandomShapes Exercise]
<b>InputAnimation Timing</b> 6 - mousePressed, mouseReleased, println (+error console)Timing [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example6 timing Example]
X - keyPressed, keyCode, keyReleased [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/example9 Example]
<b>TransfomationsVectors & Transformations</b> 7 - transforms, triangle, rect, (point)[http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/vectors Vectors]
8 - more transforms[http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/vector_ex Vector Exercise]
9 - 2D Vectors (dot, mult, etcParticle System [http://zenit.)senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/psys1 Example]
10 - class (?)<b>Exercise!</b> Modify the Particle System
11 - type demo (text, textWidth)[http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/transforms Transformations]
12 - PImage, timing, random[http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/transforms_ex Transform Exercise]
13 - Particle System
<b>===3D</b>===
X - box [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/box1 Example]
X - sphere, sphereDetail [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/sphere1 Example]
X - Vertex, Texture [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/texture1 Example]
<b>===Debugging</b>===
println [http://zenit.senecac.on.ca/wiki/index.php/FSOSS_2010/processing.js/debugging1 Example]
Checking in P5
Rrror Error console
<b>===DOM Manipulation/Library Integration</b>===
DOM Interaction [http://studio.sketchpad.cc/Qbm0fYDiTE Example]
More demos! [http://matrix.senecac.on.ca/~asalga/pjswebide/ My PJS Web IDE] ([http://matrix.senecac.on.ca/~asalga/pjswebide/index.php?sketchID=31 Visualizations], [http://matrix.senecac.on.ca/~asalga/pjswebide/index.php?sketchID=20 Spatial hierarchies], [http://matrix.senecac.on.ca/~asalga/pjswebide/index.php?sketchID=30 Image manipulation], [http://matrix.senecac.on.ca/~asalga/pjswebide/index.php?sketchID=33 Particle Systems!])
==Sample Games==Here are some Processing.js games and prototypes to give you an idea what is possible<br /> [http://pointmarker.com/webgl/test1b.html 3D Pong] by bmidgley<br /> [http://ptdef.com/ Tower Defense] by Will Larson and Peter Burns<br /> [http://matrix.senecac.on.ca/~asalga/pjswebide/index.php?sketchID=32 Core] by Andor Salga<br /> [http://bocoup.com/processing-js/docs/index.php?page=Game%20-%20Light%20Cycles Light Cycles] by Al MacDonald<br /> [http://processingjs.org/learning/topic/conway Game of Life] by Al MacDonald<br /> [http://code.bocoup.com/js-ninja/ JS Ninja] by Al MacDonald<br />[http://matrix.senecac.on.ca/~asalga/FSOSS2010/zelda/zelda-js.html Zelda] by Scott Downe<br />
PJS IDEs==Challenges== [httpCreate an empty sketch and try to code a simple game:<br />Pong!<br /processingjs.org/learning/ide Processing.js IDE]> [http://hascanvaswww.concntr8.com/ HasCanvasConcentration]<br /> [http:Flying side-scroller<br //sketchpad.cc/ SketchPad]> [http://sketchen.processingwikipedia.org/ Sketch.Processing.orgwiki/Sokoban Sokoban]<br /> ==Gotchas== [http:<ul><li>Integer/Integer division println(5/matrix2) v.senecacs.onprintln(5/2.ca0)</~asalgali><li>NPOT (Non Power of Two) textures will not load in 3D</pjswebideli><li>color does not use <b>new</ My IDE]b></li></ul>
1
edit