On 10/21/2018 at 3:49 AM, Kuurde said:
ey guys!
After some googling, and trying different stuff, I decided to start with very basic games as suggested in this article. The article also suggested to get your code reviewed, so here I am! Today I finally finished my first game, pong. ?
The source code can be found here: https://github.com/Kuurde/Pong
Oh, and you can play it here: https://kuurde.github.io/Pong/
Thanks in advance,
Kuurde
Hey,
First of all, congratulations on getting the game up on github. Version control is very important when coding in teams.
It works ( I assume). And that is what matters most!
The code is easy to read and its easy to see where you made changes. I loaded the code up and was able to see changes. I did not play the game, my environment is not set up for android programming. Thus a video clip or apk might be useful.
May I suggest a small demo video or the built version for easy download. Many developers are very busy, and would like to see the game at a click of a button.
I agree with the other poster. Fixed tick rate is very important for real-time games, and for turn based games which feature animation, for movement and effects.
I noticed you reflected the ball's speed, this is exactly how I made pong many many years ago. I would suggest moving into more advanced physics, such as rigid bodies, or using a physics library for your future projects.
Took me a bit to figure out what you were doing in the code, have not done java in some time, had to jump into an IDE to figure some things out.
I see the other AI player matches the y position of the ball. Using better physics for future projects you may want to use dead reckoning calculations to resolve where an AI should be or not be. When having objects of two difference velocities this might be useful.
I might suggest moving AI into its own file or class in future projects, so you can start thinking about it separately, and think about larger scale AI using OOP. For this project its fine.
On 10/21/2018 at 2:06 PM, Kuurde said:
next game will be snake. I'll try to add nicer menus. And I should also figure out how fonts realy work in libgdx. Now I either have small text or blurry text when I try to scale it up.
From what I was told having a menu gets the programmer points, focus on menus with better functionally, unless you do wish to do graphics as well. For example, when you press a button play a sound like a beep, or animate the button being depressed, or when the mouse hovers over. Also having the menu align to a point on the screen regardless of resolution of the screen might be an additional challenge.