This file contains hidden or 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
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| var x = random(width); | |
| var y = random(height); | |
| fill(127,10); | |
| stroke(100,90); |
This file contains hidden or 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 r = 0; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(255); | |
| r = frameCount%255; | |
| fill(r, 0, 0); |
This file contains hidden or 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 r = 400; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(0,0,0); | |
| var r = 50 + (frameCount%30); |
This file contains hidden or 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 r = 400; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(0,0,0); | |
| ellipse(width/2, height/2, r, r); |
This file contains hidden or 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 x = 0; | |
| function setup() { | |
| createCanvas(400,400); | |
| /* variables declared inside of a function are | |
| only available in that specific function. | |
| */ | |
| } | |
| function draw() { |
This file contains hidden or 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
| /* variables declared outside of functions are | |
| are called "global" as they can be referred to | |
| anywhere. */ | |
| var g_variable = 50; | |
| function setup() { | |
| createCanvas(400,400); | |
| /* variables declared inside of a function are | |
| only available in that specific function. |
This file contains hidden or 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 balls = []; | |
| var gravity = .1; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| } | |
| function draw() { | |
| background(255,255,255); |
This file contains hidden or 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 balls = []; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| x = width/2; | |
| y = height/2; | |
| } | |
| function draw() { | |
| background(255,255,255); |
This file contains hidden or 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 player; | |
| var enemy; | |
| var angle; | |
| var speed; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| player = createSprite(0, 0, 50, 50); | |
| enemy = createSprite(width/2, height/2, 100, 100); |
This file contains hidden or 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 sprite; | |
| var angle; | |
| var speed; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| sprite = createSprite(width/2, height/2, 50, 50); | |
| speed = 1; | |
| angle = 270; | |
| } |