Results 1 to 3 of 3
Thread: Combining shapes?
- 06-14-2011, 08:07 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 1
- Rep Power
- 0
Combining shapes?
Hello
I wondered if anyone could advise?
I am trying to write a very simple target game in java, with a flying spaceship moving from left to right at the top of the JPanel.
I was trying to build a flying saucer, with a circle for the window part and oval for the main part.
I wondered how best to combin the two shapes, so I could move the two combined together using one set of x and y? Could I use the Area Class?
Thank you
- 06-14-2011, 08:19 PM #2
One solution might just be to have a draw(Graphics g) method in your SpaceShip class, which uses its x and y to draw itself however you want. Then call that method from the paintComponent(Graphics g) method you overrode, passing in the Graphics as a parameter.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-14-2011, 09:09 PM #3
Similar Threads
-
Java combining arrays
By trakke in forum New To JavaReplies: 5Last Post: 04-28-2011, 09:32 PM -
problem with combining RGB binary images
By meth in forum New To JavaReplies: 0Last Post: 01-20-2011, 12:35 PM -
Combining these 2 projects
By fresh83 in forum New To JavaReplies: 14Last Post: 12-28-2009, 08:52 AM -
combining two separate codes into one
By jaiminparikh in forum Advanced JavaReplies: 22Last Post: 02-18-2009, 05:35 PM -
Help combining loops into 1 program.
By kewlgeye in forum New To JavaReplies: 5Last Post: 04-22-2008, 09:58 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks