Karl DD – Project Zero

by Karl DD @ 3:29 pm 11 January 2010

Noll

GDE Error: Unable to load profile settings

P5 APPLET

size(700, 700);
background(255);
smooth();
int yOffset = 50;
int waveHeight = 40;
for(int j = 0; j<90; j++){
  for(int i = 0; i<750; i++){
    float divider = map(i, 0, 749, 10, 35);
    line(i, yOffset + -sin(i / divider) * waveHeight, i+1, yOffset + -sin((i + 1) / divider) * waveHeight);
  }
  yOffset += 6;
}

Pong

I decided to OOP my PONG out a little.
I couldn’t add an IFRAME here because WordPress kept removing it when I saved the draft. So here is the separate page anyway:

P5 PONG

The .pde file links are dead because the .pde file type gets rejected on upload 🙁

PongBall ball;
PongPaddleUser myPaddle;
PongPaddleBot theirPaddle;
 
void setup(){
  size(600, 600);
  rectMode(CENTER_RADIUS);
  ellipseMode(CENTER_RADIUS);
  noStroke();
  smooth();
  myPaddle = new PongPaddleUser(width - PongPaddle.width * 2, height / 2);
  theirPaddle = new PongPaddleBot(PongPaddle.width * 2, height / 2);
  ball = new PongBall(myPaddle, theirPaddle, width / 2, height / 2);
}
 
void draw(){
  background(0);
  ball.draw();
  myPaddle.draw();
  theirPaddle.draw();  
}

FULL PONG SOURCE

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2016 Special Topics in Interactive Art & Computational Design | powered by WordPress with Barecity