darienyoder / software-engineering-team-beta

http://darienyoder.com/software-engineering-team-beta/minigolf
1 stars 0 forks source link

Ball bouncing #27

Open SageAndromeda opened 1 week ago

SageAndromeda commented 1 week ago

The ball doesn't bounce off the walls on a proper trajectory. It needs to go out on the same angle it came in. Ex: Ball hits wall at 45 degree angle and bounces at 45 degree angle. Ex: Ball hits wall at 20 degree angle, it leaves at 20 degree angle

clickyquack commented 6 days ago

I think I fixed this, you can see it here: https://github.com/darienyoder/software-engineering-team-beta/tree/kai. Also new problem with the windmill now being able to push it out of bounds when it couldn't before has arisen but that should be relatively easy to fix when I get the chance.

darienyoder commented 5 days ago

Using the overlaps() function between two sprites completely disables rigid collisions between them, meaning that any other object pushing behind the ball will cause it to go right through. Using the collides() function instead might solve this problem. Also, the velocity changes should ultimately be determined dynamically based on the angle of the wall instead of hard coded, in case a level has diagonal walls or has more than just those four edges.