Difference between revisions of "FSOSS 2010/processing.js/"

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
<h3>Welcome to the Game Development Using Processing.js Workshop</h3>
+
<b>Welcome to the Game Development Using Processing.js Workshop!</b>
  
 
+
==Intro (me)==
<b>Intro (me)</b><br />
 
 
<ul>
 
<ul>
 
   <li>Seneca college BSD student</li>
 
   <li>Seneca college BSD student</li>
Line 11: Line 10:
  
  
<b>Goals</b><br />
+
==Goals==
 
<ul><li>Develop a simple 2D or 3D game using in Processing</li></ul>
 
<ul><li>Develop a simple 2D or 3D game using in Processing</li></ul>
  
  
<b>Processing (aka P5)</b> [http://www.Processing.org Processing.org]<br />
+
==Processing (aka P5)==
 
<ul>
 
<ul>
 +
<li>[http://www.Processing.org Processing.org]</li>
 
  <li>Open source data visualization language</li>
 
  <li>Open source data visualization language</li>
 
  <li>Developed in Java</li>
 
  <li>Developed in Java</li>
Line 27: Line 27:
  
  
<b>Setting up Processing</b>
+
===Setting up Processing===
 
<ul>
 
<ul>
 
  <li>Download it [http://www.processing.org/download/ here]</li>
 
  <li>Download it [http://www.processing.org/download/ here]</li>
Line 37: Line 37:
  
  
<b>Processing.js (aka PJS)</b> [http://www.ProcessingJS.org ProcessingJS.org]<br />
+
==Processing.js (aka PJS)==
 
  <ul>
 
  <ul>
 +
  <li>[http://www.ProcessingJS.org ProcessingJS.org]</li>
 
   <li>Open source JavaScript port of Processing</li>
 
   <li>Open source JavaScript port of Processing</li>
 
   <li>Started by John Resig</li>
 
   <li>Started by John Resig</li>
Line 54: Line 55:
  
  
<b>Setting up Minefield</b>
+
==Setting up Minefield==
 
   <ul>
 
   <ul>
 
     <li>Minefield is much faster than Firefox</li>
 
     <li>Minefield is much faster than Firefox</li>
Line 62: Line 63:
  
  
<b>Setting up Processing.js</b><br />
+
==Setting up Processing.js==
 
  <ul>
 
  <ul>
 
   <li>3 Files Required</li>
 
   <li>3 Files Required</li>

Revision as of 07:30, 28 October 2010

Welcome to the Game Development Using Processing.js Workshop!

Intro (me)


Goals

  • Develop a simple 2D or 3D game using in Processing


Processing (aka P5)

  • Processing.org
  • Open source data visualization language
  • Developed in Java
  • "Sketches" written using Java syntax
  • Requires a JVM plug-in
  • Uses the <object> tag
  • Reference
  • Bug tracking


Setting up Processing

  • Download it here
  • Save the .DMG file to the Desktop
  • Double-click to extract file
  • Drag the Processing icon to the desktop
  • Double-click the icon to start


Processing.js (aka PJS)

  • ProcessingJS.org
  • Open source JavaScript port of Processing
  • Started by John Resig
  • Many contributions by Seneca
  • Bug Tracking
  • Does not require a plug-in
  • Uses the <canvas> tag
Lots of IDEs
Processing.js IDE
HasCanvas
SketchPad
Sketch.Processing.org
My IDE


Setting up Minefield

  • Minefield is much faster than Firefox
  • Download a working version of Minefield here
  • Instructions to enabled WebGL here


Setting up Processing.js


Coordinate system

  • size() sets canvas dimensions
  • top-left corner [0, 0]
  • X increases right
  • Y increases downwards


Basics

size, background, rect Example
setup Example
draw, noStroke, ellipse, fill, mousePressed Example
line, stroke, strokeWeight Example
ArrayList Example

Input

mousePressed, mouseReleased, println, debugging with P5 Example
keyPressed, keyCode, keyReleased Example


Text & Random

text, random Example
Exercise

Animation Timing

Timing Example


Vectors & Transfomations

Vectors
Particle System Example
Exercise! Modify the Particle System
transforms


3D

box Example
sphere, sphereDetail Example
Vertex, Texture Example

Debugging

println Example
Checking in P5
Error console

DOM Manipulation/Library Integration

DOM Interaction Example
Integration with jQueryUI - Example
Audio Example, Audio Data API Demos
Physics using Box2DJS - Al MacDonald's Demo, 0.1 PJS Crayon Physics
More demos! My PJS Web IDE (Visualizations, Spatial hierarchies, Image manipulation, Particle Systems!)

Games

3D Pong by bmidgley
Tower Defense by Will Larson and Peter Burns
Core by Andor Salga
Light Cycles by Al MacDonald
Game of Life by Al MacDonald
JS Ninja by Al MacDonald
Zelda by Scott Downe

Challenges

Create an empty sketch and try to code a simple game:
Pong!
Concentration
Flying side-scroller
Sokoban