Created
August 30, 2012 14:19
-
-
Save johnlinvc/3529453 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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