Skip to content

Instantly share code, notes, and snippets.

@johnlinvc
Created August 30, 2012 14:19
Show Gist options
  • Save johnlinvc/3529453 to your computer and use it in GitHub Desktop.
Save johnlinvc/3529453 to your computer and use it in GitHub Desktop.
private class Rect{
public int x,y,width,height;
public Rect(int _x,int _y,int _width,int _height){
x=_x;y=_y;width=_width;height=_height;
}
}
private LinkedList<Rect> queue;
private boolean isMoving;
private boolean isInc;
public void setup(){
queue = new LinkedList<Rect>();
queue.addLast(new Rect(10,10,100,200);
isMoving = false;
isInc = true;
}
private Rect r1,r2;
public void onDraw(){
if(isInc){
if(isMoving){
mover1r2();
}
else{
Rect thisR = queue.pollFirst();
spiltIntoR1R2(thisR);
}
}
else{
if(isMoving){
mover1r2();
}
else{
Rect thisR = queue.pollFirst();
spiltIntoR1R2(thisR);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment