In FindLocation2, have 2 textfields, and if the mouse is moved around the screen the coordinates appear in each textfield. If the mouse is dragged (meaning button is down), have the buttons change background color. [xField.setBackground(Color.green);]
Starter
Create SnowMan that has a small SnowMan follow the cursor
around (draw on temporary layer Graphics g=getTempG() ). (A snowman could be just three circles on top of each other - or an image)
Starter
In AnnoyTheUser have a circle that appears at a random
location. When the user moves the cursor close to the circle (say within
30 pixels), the circle will move to a new random location. Fun.
public double distanceToCenter(int centerX, int centerY, int mouseX, int mouseY)
{
int a=centerX-mouseX;
int b=centerY-mouseY;
return Math.sqrt(a*a+b*b);
}
Code for drawing originally in the program
public void paintScreen (Graphics g)
{
//draw on g here
}
In Rainbow have a rainbow of colors appear when the user moves the mouse. It will be beautiful; kind of like a rainbow.Use g.setColor(Color.blue) or any color Have a reset button.
Starter
In DrawDynamicRect that when the user presses down and then drags their mouse it will constantly draw (and erase) a rectangle that is that size. When they release the mouse, it will finalize that rectangle. (code will be in mousepressed, mousedragged and mousereleased) [advanced - have it work in any direction]//Code to get a random color
g.setColor(findRandomColor());
Starter
In Gradient that when the mouse is moved left or right, it will adjust the amount of red in the background. If it goes up or down, it will adjust the amount of green.g.setColor(new Color(r,g,b) where r,g,b are the amount of red green and blue)
Starter
In ConstantLine when the mouse is pressed it will start drawing a new line and connect the dots to make the line like good. (so there is no gaps). Each time they press down, a new line will be drawn.Starter
Advanced
In Operation, there will be a square inside a square. The idea of the game is that the user must move their mouse around the inside of the square without hitting the walls. It will keep track of how much time it takes for them to accomplish this goal. Put this inside paintScreen:
You probably will want to have a global int corner; Where whenever they make it to a corner it will change which corner you need to hit next. This is hard, but oh what a fun game it would be.
Timer here
That part is required. Additional ideas:
give them 2 seconds to get in the safe region originally.