Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add rebound angles for the ball depending on the bar #10

@jaBote

Description

@jaBote

This will have something to do with the position from which the ball collides with the bar:

3 rebound angles:

  • 30º (dx = 2; dy = 1);
  • 45º (dx = dy = 1);
  • 60º (dx = 1; dy = 2);
    in each of the 4 directions.

About the rebound results (not final rebound sizes):

  • if ball collides with the bar on its edge (around 10% of its size) it will rebound with 60º
  • if ball collides with the bar on its edge (between 10% and 25% of its size) it will rebound with 45º.
  • If ball collides with the bar on its center (around the remainder 25% of the bar size), it'll rebound with 30º.
    Rebound will be to the left if the collision is on the left side and to the right if the collisions are on the right side of the bar.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions