• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help with making a game

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am making a game where I have to divide the frame into two parts the game board and the control panel.
I don't know where to start.



Your help is greatly appreciated.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you want the divider moveable, you
could use a JSplitPane.

if fixed divider, use a JPanel set as BorderLayout,
board goes in CENTER, controlPanel goes to
EAST WEST NORTH or SOUTH, depending
on where you want it.
 
Krupa Patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am kind of confused. I do not know if i am doing it correctly.
I am creating a breakout game where I have to divide the frame into two, the game board and the control panel.
The control panel will display the score, restart button, and etc. This is my code.

Please help me. Thank you.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you don't need the indicated lines - in fact they're dangerous
because they are added to (the default position) CENTER, then
removed to add at a specific location EAST/WEST



you need to work out what you want to do with the height of everything
you have 250 for one panel, 550 for another, then set the frame to 800,
this works for the width, but if you want those specific height dimensions
you'll need to use holding panels to take up the extra space.
 
Krupa Patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much.
 
Krupa Patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two paddles in my breakout game where I have to click on the paddle and move the paddle by moving the mouse.
Please help me.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This appears to be a homework assignment (Breakout?), so you have to ask specific questions,
not just a general fix it for me.

Your Paddle class is all wrong - try it again, repost with specific problem, if any.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic