First of all, let me just say that this is my first forum message..
And without further Blah Blah i'll get to the questions.
I have recently started developing in Java.. which I think is a great language and decided to do some graphic applications (games).
so I began doing something which uses double buffered graphics, the game consists a falling ball which avoids obstacles by pulling itself up whenever space is pressed (a tribute to a friend of mine who did it in VB
), anyway.. the mechanics are all done and i want to replace my ball (filled oval) with an image of a ball, I've tried different techniques to load an image and draw it to a Graphics2D object, but no luck.. so could anyone explain how to do it?
My second question relates to the double buffering technique, I know it is used to prevent flickering. but my obstacles (which are currently empty 3DRects) are tearing as they move (I switched to draw3DRect from fill3DRect because i wanted to hide the tearing effect,
My technique is as follows - i get the graphics from an Image, render my ball, obstacles etc. to it and then calls repaint(), I have overrided paintCompotent(Graphics g), so it should be ok (It is explained in a book about java games programming).
Help would be greatly appreciated..