write an C++ program for or C# program for a simple pong game
Answers
Explanation:
Both C# and C++ can be used to create games. However, C++ has better control hardware on the PC or server.
Therefore, it is usually a more suitable language for game development. However, both languages are for game development, especially knowing that you won't be creating games from scratch.
Answer:
I started the program with just making the ball bounce back and fourth against the walls, left to right.
To do this, I first made what I call the WorldFrame. I added a Panel in the right size and location.
In this panel, I then created a picturebox representing the ball called "pb_Ball".
After this, I made a timer called "timer_Movement" and had its interval set to 1 ms.
The tick event of this timer is what makes the ball move, I use a Boolean to check whether to go left or right. If the ball hits either of the walls, it changes the Boolean and makes the ball go in the other direction.
Here's how I check if the ball hits the wall: