Processing
We spent 3 weeks using a piece of software called Processing. I used it first to figure out the features and get used to coding using it and then I began to develop my own piece of software using processing to form a final project.
I first created many pieces experimenting with the different options and different features. These usually consisted of balls moving around a screen, bouncing objects, objects changing colour and experimenting with the mouse and keyboard functionalities.

Once I had got used to the software and the code, I began to develop my own piece of software. The idea I had come up with was to do a very simple application where you could draw images using both colour and black and white.
The first thing I did was to set up the application using "void setup". This allowed me to set frame size, background, text size and colour mode. I then set up the variables that I needed at the top of the code, which I added to as I went along and figured out how to do certain things.

After this is "void draw" where all of the main functions happen, inclluding the set up of the menu bar first, then the mouse functions. when the left mouse button is pressed, a line is drawn from the mouses previous position (pmouse) to the mouses current position (mouse), allowing a solid line to be drawn. This part of the code is made up entirely of variables as all of the different options for the brush can be changed. After the left mouse button options are the right mouse button options, this is the eraser. I couldn't find a way of physically deleting the lines that were drawn so instead I made the right mouse button just draw the colour of the background over the drawn lines which works well.

After the mouse settings I set up the keyboard settings using "void keyReleased". This makes certain things happen when selected keys are released, which allows me to make the changeable options.
To make a condition in this section, I had to use if statements to decide what to do when certain keys are pressed. An example is:

if(key == 'f')
{saveFrame("paint-######.png");}

This means that if the "F" key is pressed then a screenshot of the application is taken.

The majority of my conditions are made with nested if statements. This is when there are two conditions to an if statement, for example:

if (size <= 150)
{
if (key == 'w')
{
size=size+5;
menuX=menuX+5;
}

} else {}

This means that if the variable "size" is less than or equal to 150 AND the 'w' key is pressed, then the size and menu position will change. If one of these things happens but not the other, then the "else" condition will occur. In this case, else does nothing.
This is the remainder of the code, made up of keyboard conditions and if statements
This is a short video demonstrating all of the functionalities of the application that I made. I tried several times and several different ways to embed the application in to this page but it would not work, so instead I took a screen recording and uploaded it to vimeo, then embedded that instead. I have also supplied a download link for the application zip file below. pii
PAINT.zip download
zip