View Full Version : animation java help


pumaz100
12-02-2007, 03:20 PM
i have computer science hwk and I'm not very good at java. The problem is to get fill a red rect at like 0,200 and a blue circle at 200,0. then they have to move arcross(rect) and up-down(circle). I have that part down pat. But i don't know how to repaint the rect green when it hits right side and red when it hits the left. and the oval has to be blue going down and yellow going up. I know i need and if statment to look like this:


If("idk what to do here"){
page.setcolor(color.green);
}

page.fillRect(rx,ry,rw,rh);
to redraw rect when it hist the left side

R0b0t1
12-02-2007, 07:05 PM
Before asking here, you should take a look at the Java documentation. Look under the Graphical stuff.