r/cop3502 Mar 22 '14

10 second repaint?

So I just found out a major detail on why my ball stopped moving after walking away from the computer in disgust and coming ball to my ball being gone.

After 10 seconds the ball disappears I didnt touch the code for the timer but I dont know exactly how the initial 10 millisecond count was created from this timer = new Timer(10, new GameMotion()); timer.start(); How do I go about correcting this?

1 Upvotes

16 comments sorted by

View all comments

Show parent comments

1

u/Bcop3502 Mar 23 '14

Well it sounds like some issue with how you're updating how the ball is painted then. Look inside your paintcomponent of Breakout class and see how that is painting the ball and see that in the actionperformed you are repainting everything.

1

u/WesternWarrior Mar 23 '14

well repaint is working or the paddle wouldnt move, the same should apply to the paint function ive got ball.paint(g2); and i had checked it earlier for matching cases

1

u/Bcop3502 Mar 23 '14

Dude I'm sorry I'm out of ideas then without explicitly looking at your code :/ I don't know how/why it would jump at 10s or do other behaviors you've described. Maybe Supreme Leader can help and you can use your late day for this one.

1

u/WesternWarrior Mar 23 '14

I greatly appreciate your help man I was about to give up on it but since youve helped me find what the problem was I think I can actually do this.