Tuesday, 13 March 2012

Updating the Physics Engine

A more Updated version of the Physics engine was ready to be placed on the Web Server.

The physics engine was being tested by using a mouse click to place a ball and create a movement vector on the ball which simulated the shot.

For the web server, this mouse click was undesirable and it was required that the mouse handlers be removed which is difficult since the mouse clicks determine the ball positions.

Instead of the mouse click determining the position of the balls, a 2-d Array which acted as a map was used, this contained a value of '2' where the balls where. The location of the twos gave the co-ordinates of the balls, and so a ball was placed at the co-ordinate.

It was tested using a perfect circle drawn on a rectangle on microsoft paint. This didn't include the scaling algorithm and so the pixel co-ordinate matched the table co-ordinate.

Chris

No comments:

Post a Comment