Ro
HOME
ugh
Dra
fts
WORK
.
.
.
CONTACT
BIO
pde
SNOW(ISH)

My first idea was to try out the random function and see how I could manipulate the ellipse, it started of with the draw function randomly displaying a white ellipse, as I had designated no colour.

I thought it was a cool effect so I added a mousePressed function to the randomised if statement, so whenever I pressed the left mouse button, random "snow" appeared".

I then also made another ellipse to have the position of my mouse cursor, just to toy around with how it looked.

Given how simple it is, I think it is actually quite interesting, I was going to pursue some more ways to make it more like actual snow; possibly by increasing the amount of ellipse or a for/while loop.
Implementation
int radius = 10, directionX = 1, directionY = 0;
float x = 20, y = 20, speed = 10;

void setup()
{
background(0);
size(200,200);
smooth();
ellipseMode(RADIUS);
}


void draw()
{

background(0);
x=x+speed*directionX;
y=y+speed*directionY;

if((x>width-radius) || (x {
directionX=-directionX;
}
if((y>height-radius) || (y {
directionY=-directionY;
}


ellipse(x,y, radius, radius);
fill(0);
stroke(255,0,0);


}


void keyPressed()
{
if (key == CODED);
{
if (keyCode == LEFT)
{
if(directionX>0)
{
directionX=-1;
directionY=0;
}
}
else if(keyCode == RIGHT)
{
if(directionX<0)
{
directionX=1;
directionY=0;
}

}
else if(keyCode == UP)
{
if(directionY<0)
{
directionY=-1;
directionX=0;
}
}

else if(keyCode == DOWN)
{
if(directionY<0)
{
directionY=1;
directionX=0;
}

}

}
}
pde
ATTEMPT AT MOVEMENT

I was looking at some games people had made on Processing, games like worm and how they did the movement.

I managed to get the left and right movement correct (but only when the object is moving already) but I still can't go up and down, and even if I could it would not be fluid movement.

The code to the left is what I used.

SPIRAL

This started off as an experiment, I wanted to learn some new functions so I looked and saw the sin and cos rules in the resource library. I made up some random float variables and entered them into the example equation they had on the website and managed to get a nice arc, the above example was the result of a bit more tinkering.

I really enjoyed processing, the way it has such a visual response definitely appealed to me given my art background. It made the prospect of learning a proper programming language a lot less intimidating now that I know some of the very basic fundamentals of Java.
WORK
HOME
You really have to spam right and left to see any kind of affect on the ball.
I should really have lowered the speed.