C++ Pong SFML p2
ฝัง
- เผยแพร่เมื่อ 7 ต.ค. 2024
- this is the second video of creating pong in sfml part 2, in this video we will be learning how to use C++ with sfml to setup the paddle and make it where you can move it and hit the ball
sidenote: I also can see that the ball looks blurry and skippy in the video, however it doesn't actually look that way on my screen it's just a result of the recording
I think you missed to go over the function hitBall in the last video, but added the function:
void Ball::hitBall()
{
m_DirectionY = -m_DirectionY;
}
In Ball.cpp
i very well may have missed it, I'll take a look
Thank you I did on accident
The error you were getting was from spelling m_Shape like m_spape you mixed up the h with a p
please how did you implement the hitball function? I could not find it, my ball is penetrating the paddle. I have tried to do it but the logic behind it is confusing. kindly help me resolve that. Thank you Sir.
I lost the code to that video due to a hardrive error however i believe the function is
void Ball::hitBall()
{
m_DirectionY = -m_DirectionY;
}
It is working. Thank you so much! @@FFDEV