Forum Stats

  • 3,824,997 Users
  • 2,260,452 Discussions
  • 7,896,379 Comments

Discussions

PuzzleBall bug list

OTG-467455
OTG-467455 Member Posts: 506 Bronze Badge
edited Nov 23, 2017 3:44PM in Java Puzzle Ball

I have come across the following  abnormal behaviors:

  1. Ball will run through the level geometry on the line between blocks
  2. Ball will skim along the bottom of game window and then behind level geometry
OTG-467455

Answers

  • NickR2600-Oracle
    NickR2600-Oracle Member Posts: 530 Employee
    edited Nov 22, 2017 3:42PM

    Ah, is this the bug?

    pastedImage_0.png

    I have a story about that... It has to do with the order that collision detection lines are checked and the angle of incidence.  The collision lines around each piece of level geometry are kept in List.  When the ball collides with the first triangle (shown on the bottom-left corner of the screenshot), there are two possible collision lines: a diagonal on the left side of the shape, and a flat line at the bottom of the shape.  It must be the case that the diagonal line is first in the list, so this is the line used to determine the angle of reflection. The angle of reflection is something that's looked up by the program.  It's not something determined by physics.  In the case of the second triangle (shown on the bottom-left corner of the screenshot), the flat line at the bottom of the shape appears sooner in the List than the diagonal.  I must have forgotten to state what happens when a flat line is struck from the right or left.  So the game thinks a collision is happening, but does nothing to change the angle of the ball, so the collision keeps happening over and over..  I remember when I was originally developing the game, I was short on time and thought "This bug is funny.  I'll leave it in".  I think most of the levels are designed carefully enough that a bug like this can't occur too often.

    OTG-467455OTG-467455
  • OTG-467455
    OTG-467455 Member Posts: 506 Bronze Badge
    edited Nov 23, 2017 3:44PM

    Yes that is one of the bugs.  The other one I noticed is where the ball cuts through the level geometry on the line between the blocks.