Coding (Sessions 4 & 5)

November 7, 2013 § Leave a comment

Thinking & Practice Tutorials

In session four we went back and visited some of the stuff we did in the first session with the rotating line. The line moved around the composition without exiting the boundaries, and as the line was opaque it made a trail as it moved. We edited the position on the axis so that we could control the point at which the line moved around, and then the speed. Then, by using codes similar to this one:

if(xpos<0) xinc=3;

This determined the boundaries that the line would not be able to move across. This meant as the line moved around it would stop when it reached the edge of the composition and move to the other side.

In session five we tried something new. We created a code that would enable a small shape to bounce around the composition. We then added multiple shapes however the code that restricted the shapes from leaving the canvas was left out; this was our challenge – to see if we could work out which part of the code would keep the shapes inside the composition.

Screen Shot 2013-11-06 at 14.35.59 Screen Shot 2013-11-06 at 14.58.00

The codes we used included co-ordinates for the shapes as well as the speed settings and position again for the x and y axis. By changing the float position and duplicating previous codes we could alter the shape’s path. The final composition and it’s code looked like this:

Screen Shot 2013-11-06 at 15.20.52Screen Shot 2013-11-06 at 15.20.52 - Version 2


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

What’s this?

You are currently reading Coding (Sessions 4 & 5) at Tom Davidson.


%d bloggers like this: