Drawing Software

This slideshow requires JavaScript.

Here’s my code:

int X;
int Y;
int brush;

void setup(){
size(700, 500);
background(255);

}

void draw(){
//Actual Fun stuff starts here

//Brush

ellipse(mouseX, mouseY, 20, 20);
noStroke();
}
//Use the arrow keys
void keyPressed(){
if (key == CODED)

fill(226,221,221);
if (keyCode == RIGHT)
rect(X, Y, 10, 10);
X = X+1;{
Y=Y+0;
}

if (keyCode == UP){
rect(X, Y, 10, 10);
X = X-1 ;
Y= Y-2;
}
else{
stroke(0);
}
if (keyCode == DOWN){
rect(X, Y, 10, 10);
X = X-1 ;
Y= Y+2;
}
if (keyCode == LEFT){
rect(X,Y, 10,10);
X= X-2;
Y= Y +0;
}
else{
stroke(0);
}
//Doubled to increase speed of Rect
if (keyCode == RIGHT)
rect(X, Y, 10, 10);
X = X+1;{
Y=Y+0;
}

if (keyCode == UP){
rect(X, Y, 10, 10);
X = X-1 ;
Y= Y-2;
}
else{
stroke(0);
}
if (keyCode == DOWN){
rect(X, Y, 10, 10);
X = X-1 ;
Y= Y+2;
}
if (keyCode == LEFT){
rect(X,Y, 10,10);
X= X-2;
Y= Y +0;
}
//change color

//Blue
if (keyCode == ‘1’){
fill(0,0, 255);
}
//Green
if (keyCode == ‘2’){
fill(0, 255, 0);
}
//Red
if (keyCode == ‘3’){
fill (255, 0, 0);
}
//Yellow
if (keyCode == ‘4’){
fill( 255, 255, 0);
}
//Black
if (keyCode == ‘0’){
fill(0,0,0);
}
}

Advertisements

About Alex Mandzi

I'm a new artist and wish to become a game designer. I like cartoons and draw them as well.
This entry was posted in Computer Animation, Non-Time-Based and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s