• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with Graphics in MVC structure  RSS feed

 
pp oo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I testing to implement graphics into MVC structure but Im a bit stuck. Here is what I got so far. For now I just want to get the red ball to bounce back and forth. And use the button start to start the thread and button stop to stop the thread that runs the GameLoop in the controller.

But I think Im mixing this up a bit. Would very much appreciate some feedback!

Heres what I got so far:

**GameModell**
suppose to controll the bouncing. If the location of the ball is under 40 px or above 80 px - multiply the locationX with -1 to make the ball change direction

**GameView**
Here Im putting the labels on a JFrame. I also want to display the buttons start and stop to controll the thread but I guess they are hidden by the JPanel in **TheGraphics** class

**GameController**
Starts and stops the thread with ActionListeners. Contains the GameLoop

**TheGraphics**
Paints the ball and controll the direction

I guess I got a lot of thing that are all wrong but this is the best I can do at the moment. Would very much apreciate some help!

Thanks!

MAIN:



MODEL:



VIEW:



CONTROLLER:



THE GRAPHICS

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!