- disk point picking http://mathworld.wolfram.com/DiskPointPicking.html
- Simulate movement across landscape similar to Charlie Deck's Noon Dunes design? http://bigblueboo.tumblr.com/post/142516604819/noon-dunes
- Games
- space invades
- snake game
- pong
- simon game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var particles = []; | |
function setup() { | |
for (var i = 0; i < 10; i++) { | |
particles[i] = { | |
x: 100, | |
y: 100, | |
display: function() { | |
ellipse(this.x, this.y, 16, 16); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 10print.org | |
// Animated version of 10 print. | |
var x = 0; | |
var y = 0; | |
function setup() { | |
createCanvas(640, 360); | |
background(255); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script language="javascript" src="p5.js"></script> | |
<script language="javascript" src="sketch.js"></script> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script language="javascript" src="../../lib/p5.js"></script> | |
<script language="javascript" src="sketch.js"></script> | |
<script language="javascript"> | |
//$(document).ready(function() { | |
window.onload = function() { | |
$('#defaultCanvas').appendTo("#container"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var checkbox; | |
function setup() { | |
checkbox = createCheckbox('the label'); | |
checkbox.checked(true); // passing in an arg sets its state? | |
// What should this be called?? | |
// it's wrapping 'onchange' | |
checkbox.changed(myCheckedEvent); // even for when the user does something | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int val; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(3, INPUT); | |
} | |
void loop() { | |
val = analogRead(0); | |
Serial.write(val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile-time: | |
Missing a semi-colon ";" | |
Missing left parentheses "(" | |
Missing right curly bracket "}" | |
The variable “myVar” doesn't exist. | |
The local variable “myVar” may not have been initialized. | |
The class “Thing” doesn't exist. | |
The function "myFunction()" expects parameters like this: myFunction(type, type, type, ...) | |
The method "function(type, type, type, ...)" doesn't exist. | |
Error on "_____" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas; | |
var button; | |
function setup() { | |
// Make a canvas | |
canvas = createCanvas(100,100); | |
// Make an HTML DOM element, a button! | |
// The button will have the word "submit" in it | |
button = createButton("submit"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var request = require('request'); | |
var url = 'https://farm8.staticflickr.com/7484/15685407577_d19030d469_m.jpg'; | |
var saveFile = 'test.jpg'; | |
request.head(url, getImage); | |
function getImage(err, res, body) { | |
var req = request(url); |