Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function 1/purple maze:
- // SETUP - Runs only Once
- void setup(){
- size(800,600);
- background(200); // 0-255
- background(179,233,255); // RED line
- }
- // DRAW - A loop! Will run forever!
- void draw(){
- // ( x, y, w, h)
- // ellipse( mouseX, mouseY, 13*10, 13*10);
- }
- void mouseDragged(){
- fill(#EADFFF);
- square( mouseX, mouseY, 49);
- }
- function2/doodle:
- // SETUP - Runs only Once
- void setup(){
- size(800,600);
- background(200); // 0-255
- background(#D2FFEB); // RED line
- }
- // DRAW - A loop! Will run forever!
- void draw(){
- // ( x, y, w, h)
- // ellipse( mouseX, mouseY, 13*10, 13*10);
- }
- void mouseDragged(){
- ellipse( mouseX, mouseY, 1, 1);
- }
- function3/screenshot/attempted animation:
- void mouseMoved() {
- fill(#FFD7D7);
- square( mouseX, mouseY, 49);
- }
- PImage lol;
- void setup() {
- size(1390, 1366);
- lol = loadImage("lol.jpg");
- }
- void draw() {
- background(0);
- image(lol, 0, 0);
- }
- hw2/animation test:
- float x = 100;
- float y = 200;
- float speedX = 2;
- float speedY = 0.5;
- float circleSize = 5;
- void setup(){
- size(500, 500);
- background(#BDDCFF);
- }
- void draw(){
- // Behavior
- fill(random(#B7FFC1),random(255),random(193));
- x = x+speedX;
- y = y+speedY;
- circleSize = random(10, 45)/10;
- // Drawing the ellipse
- ellipse(x, y, 35, 35);
- //Reset the position
- x += speedX;
- if(x > width || x < 0){
- speedX *= -1;
- }
- y += speedY;
- if(y > height || y < 0){
- speedY *= -1;
- }
- }
- hw2/animation:
- float x = 100;
- float y = 200;
- float speedX = 2;
- float speedY = 3;
- float circleSize = 5;
- void setup(){
- size(500, 500);
- background(#BDDCFF);
- }
- void draw(){
- // Behavior
- fill(random(255),random(255),random(193));
- x = x+speedX;
- y = y+speedY;
- // Drawing the ellipse
- ellipse(x, y, 100, 100);
- //Reset the position
- x += speedX;
- if(x > width || x < 0){
- speedX *= -1;
- }
- y += speedY;
- if(y > height || y < 0){
- speedY *= -1;
- }
- }
Add Comment
Please, Sign In to add comment