xxxxxxxxxx
//Generated by Derek Gryga
//Tapeworm Berzerka
//---------------------------------
//Array
int numOFseg = 1000;
//float[] segX = new float [numOFseg];
//float[] segY = new float [numOFseg];
//Seg seg1 = new Seg();
//--------------------------------------
//Other Variables
int objNum = 1000;
float degrees = 360/objNum;
float angleOffset = 0;
float distance = 30;
//---------------------------------
void setup() {
size(1000, 1000);
// seg1.PosX;
// seg1.PosY;
println("Tapeworm Berzerka");
}
//---------------------------------
void draw() {
background(0, 0, 1);
// for (int i = 0; i < numOFseg; i++) {
//seg1.Display();
distance = 10;//start close to the mouse
fill(0, 0, 255);
for ( int i =0; i<objNum; i++) {
float xOffset = cos( radians(degrees + i + angleOffset)) * distance;
float yOffset = sin( radians(degrees * i + angleOffset)) * distance;
ellipse(mouseX + xOffset, mouseY + yOffset, 33, 33);
distance+=2; //Each object goes further out into the spiral, or worm. Adding a segment to the worm.
}
angleOffset -= -2;//Rotates the spiral, or worm. Like twirling a lasso, from the hand it rotates.
// if (seg1.PosY >= 800) {
// background = (240, 0, 240);
}
// if (seg1.PosY < 800) {
// background = (10, 1, 1);
// class Seg {
// //Attributes
// segSizeX ;
// segSizeY ;
// segColor1;
// PosX ;
// PosY ;
// //Constructor Statement
// Seg() {
// segSizeX = 33 ;
// segSizeY = 33 ;
// segColor1 = color(0, 68, 201);
// PosX = mouseX ;
// PosY = mouseY ;
// }
// //--------------------------------------
// void Display() {
// fill (segColor1);
// ellipse(PosX, PosY, segSizeX, segSizeY);
// }
// }