Ok for my uni project im wondering if its possible to make a simple game where by the user must click a button ten times to win.
the button has to move after every click to a random point on the screen.
Does anyone know if there are any tutorials for this kind of thing available?
or would it be easy to script?
Thanks
James
jamesyrawr
0
Newbie Poster
Recommended Answers
Jump to PostHey man, whatsup!
Check out the little piece of code here:int btnClicked = 0; public btnActionPerformed(actionEvent e) { if(btnClicked==10){System.out.println("You win!"); else{btnClicked++;} }
Then with the button moving and all that, there's a layoutManager (not sure which one) that you can set the x and y coordinates …
Jump to PostWhat you can also do, use math.random() to generate some radom number, parse it to an int, then use those ints as the value for the x and y coordinates. Then the button will just pop up where ever the heck it feels like! It will be crazy like a …
All 5 Replies
Dean_Grobler
48
Posting Whiz in Training
Dean_Grobler
48
Posting Whiz in Training
sharathg.satya
-10
Posting Whiz in Training
sharathg.satya
-10
Posting Whiz in Training
sharathg.satya
-10
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.