claw-machine-js
Version:
A physics based claw-machine simulation
35 lines (34 loc) • 1.7 kB
TypeScript
/**
* Returns the Ball Radius for the current Ball to be inserted into the Machine
*
* @param individualBallRadius The individual Ball radius if it is overwritten
* @param generalBallRadius The general Ball radius that is also used as fallback
*/
export declare const getBallRadius: (individualBallRadius: number | undefined, generalBallRadius: number) => number;
/**
* Returns the Initial X value of the Ball that is defined by the user and if it is not it returns a random x position
*
* @param xPosValue The explicit X position of the new ball if it es defined
* @param width Current width of the simulation
* @param dividerLineWidth Width of the drop area
*/
export declare const getBallInitialXPos: (xPosValue: number | undefined, width: number, dividerLineWidth: number) => number;
/**
* Returns the Initial Y value of the Ball that is defined by the user and if it is not it returns a random y in the lower half of the simulation position
*
* @param yPosValue The explicit Y position of the new ball if it es defined
* @param height Current height of the simulation
*/
export declare const getBallInitialYPos: (yPosValue: number | undefined, height: number) => number;
/**
* Returns the start momentum of the ball on the X-Axis if it is not defined it returns a random value
*
* @param dx The explicit momentum on the X-Axis if defined
*/
export declare const getBallInitialXMomentum: (dx: number | undefined) => number;
/**
* Returns the start momentum of the ball on the Y-Axis if it is not defined it returns a random value
*
* @param dy The explicit momentum on the Y-Axis if defined
*/
export declare const getBallInitialYMomentum: (dy: number | undefined) => number;