Skip to content

Commit

Permalink
Create Camera
Browse files Browse the repository at this point in the history
  • Loading branch information
broseidon91 committed Nov 22, 2013
1 parent ffa37ca commit 6f33153
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Camera
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class Camera
{
float x = 0;
float y = 0;
PVector speed = new PVector(0,0);
PMatrix2D matrix = new PMatrix2D();
PMatrix2D tmatrix = new PMatrix2D();
void update()
{
x += speed.x;
y += speed.y;
speed.x *= .9;
speed.y *= .9;
matrix.reset();
matrix.translate(-x, -y);
tmatrix = matrix.get();
tmatrix.transpose();
}



}

0 comments on commit 6f33153

Please sign in to comment.