Hi
I have a HW is to create bouncing ball that moves(diagonal) and when i click to it, the ball should stop...
my problem is how to stop the moving ball ???
The code I'm afraid to put it online(here) because it's HW and maybe some one take my HW and submit it... So, if any one can help me with it, i can send my code to it to figure the problem...
please guys i really need your help..
thanks in advance
how to stop bouncing ball ?
Page 1 of 16 Replies - 2217 Views - Last Post: 01 June 2009 - 08:35 PM
Replies To: how to stop bouncing ball ?
#2
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 07:36 AM
why would some copy it.. it does not work yet...
post the code and you will get a lot more help
post the code and you will get a lot more help
#3
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 07:39 AM
How do you stop a bouncing ball? Catch it. :\ 
Try stopping or pausign the thread thats controlling the ball.
Try stopping or pausign the thread thats controlling the ball.
#4
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 07:46 AM
gl3thr0, on 1 Jun, 2009 - 06:36 AM, said:
why would some copy it.. it does not work yet...
post the code and you will get a lot more help
post the code and you will get a lot more help
No, it does work.... the Hw have many parts in it...
the main thing is to create a bouncing ball and move in diagonal ... and there is a zone that when a ball is entering it , it should check if there is some one else there or not.. if there are they should wait...
and all of these thing i did finish from it... all thing that i need is to stop the ball when i click on it...
and there is another parts, but i want to finish from this part and then continue to the other parts if i have times...
So, for that reason i can't post it online...
i will send it to you "gl3thr0"...
i hope you can help me in it... & check ur mail
thanks
#5
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 08:04 AM
you should have an if statement that would stop it and if you wanted to start it up again you would use another if statement. hope that helps
#6
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 08:11 AM
computerfox, on 1 Jun, 2009 - 07:04 AM, said:
you should have an if statement that would stop it and if you wanted to start it up again you would use another if statement. hope that helps 
I know that, but it's not that easy.. Since i have many ball and many thread, how can i stop any one of them...!!! ?
Can i Pm u the code???
thanks
#7
Re: how to stop bouncing ball ?
Posted 01 June 2009 - 08:35 PM
does the ball itself have a thread though. If so you can just stop that thread upon mouse click. you said that you already many threads, so to the thread with the ball just add a mouse Listener. and when an action is done you can have a boolean saying weather the ball is moving or not, and do what you need to do
if(moving) ballThread.stop(); if(!moving) ballThread.start();
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote








|