#๐Ÿ”’ Problems creating Pong game in Pygame - Collisions

24 messages ยท Page 1 of 1 (latest)

spice panther
#

Problems creating Pong game using Pygame - Collisions. Bug found during collisions with paddles and walls, especially a problem when increasing speed.

remote fernBOT
#

@spice panther

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

spice panther
#

i think there is a problem with my maths in the code, if anyone is expect and has experience with these types of stuff pls help

#

im tryna make my game run nice and smoothly

wild folio
#

can you post the code

spice panther
thin vector
#

Why is def move inside an if / else statement?

spice panther
#

its their temporarily but it shouldnt matter i believe

#

Problems creating Pong game using Pygame - Collisions

thin vector
#

Are you going for non realistic bounces on purpose?

#

I have always just used an x increment and y increment and changed the direction on a wall/paddle hit by changing the sign of the increment

#

The sin cos seems overkill

spice panther
thin vector
#

The video shows hitting the side and bouncing near vertical.

spice panther
thin vector
#

If the ball is moving at an angle and hits the top/bottom the y move should not change just the x move should only change by direction not velocity

#

With your sin/cos and normalization it is hard to know what is happening

spice panther
thin vector
#

I guess you need someone smarter to help then. If I can't follow the math I can't help. Sorry. Wish you luck.

remote fernBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ Problems creating Pong game using Pygame - Collisions

remote fernBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.