hey guys, I am pretty new to LibGDX and also to Over ALL programming yet i consider my self intermediate in programming. I started exploring LibGDX a few days ago, and read theory, along with some practice of creating shapes and running some loops. So I decided to code a simple PONG game to see how things work. I have created a Ball using Pixmap, and its randomly moving on the screen colliding with the ends of the screen etc, so i tried to make a Paddle using fill rectangle and new Pixmap but its not working, i mean if i ma increasing its width its increasing fine but if i am increasing its height its not working.

Is it okay to use 2 Pixmaps in a game? I know pixmaps a pretty slow but for a beginner like me isn't it a good way to know the basics?

is there any other way i can draw shapes more efficiently ?

PS: Pardon me for my bad english, Its not my first language. Thanks.

Below is the code: Any suggestions about improving the writing style would also be appreciated

If you are only targeting desktop, this isn't such a big deal, but you should still read through the article to get a better understanding of everything. Pixmaps aren't "slow" in the way you are using them.

Ultimately the best thing to do in your case is just to use textures; i.e. a circle ball texture and a rectangular paddle texture. Usually you would use something like TexturePacker, but for a simple pong game you could just use separate textures. Then you would render them like this:

Thanks you so much for the reply davedes, I really appreciate your quick response. I'll read the articles, Explore more about the shape renderer and will bug you more if i have any queries, Thanks once again.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org