nailed balls i think
Class cvpmCaptiveBall
This class is used to handle captive balls on the playfield. The handler takes the hitting balls velocity and angle into account when moving captive ball.
The Captive Ball requires the following elements:
1. One or two kickers for the moving ball. (If two kickers are specified the ball will rest in the first and the second will be used to kick out the ball)
2. A wall that holds the captive ball back
3. A trigger in front of the wall. (To estimate the ball speed).
· Method: .InitCaptive trigger, wall, kickers, ballAngle
Initialises the captive ball obejcts (Does not create the ball).
trigger Trigger placed in front of the captive ball. (optional but operation will be much better if it there)
wall Wall holding the captive ball back.
kickers One or two kickers for the normal captive ball + kickers for “nailed” balls.
ballAngle The angle the captive ball should move.
Example:
cbCaptive = New cvpmCaptiveBall
cbCaptive.InitCaptive CaptiveTrigger, CaptiveWall, Array(Captive1,Cative2)
· Property: .NailedBalls = nailedballs
Specify the number of nailed balls. (default 0). One extra kicker must have been specified in the InitCaptive method for each nailed ball.
nailedBalls: 0-n
· Method: .Start
Start the captive ball handler, i.e. create the moving ball. Note that if “nailed” ball is used, the actual ball must be created manually
Example:
Captive Ball with a red “nailed” ball
cbCaptive.InitCaptive CaptiveTrigger, CaptiveWall, Array(Captive1,Cative2,Captive3)
cbCaptive.Start
Captive1.CreateBall.Color = vbRed
· Property: .ForceTrans = fTrans
· Property: .MinForce = minForce
Controls the movement of the captive ball.
fTrans The amount of the hitting balls speed that is transferred to the captive ball (0-1). Note that the hitting ball’s speed is not reduced. Use the elasticity of the wall to control the hitting balls speed.
minForce The minimum force applied to the captive ball. If set to low the captive ball might not return to its resting position. (depends on the distance between the moving ball’s kickers and table slope.)
Example:
cbCaptive.ForceTrans = 0.4
cbCaptive.MinForce = 3.5
· Property: .RestSwitch = swNo
Switch activated when the ball is in the resting position
Example:
cbCaptive.RestSwitch = swCaptiveResting
· Method: .CreateEvents instance
Creates the events required for the captive ball
instance: The name of the cvpmCaptiveBall object.
Example:
cbCaptive.CreateEvents “cbCaptive”
· Method: .TrigHit ball
· Method: .BallHit ball
· Method: .BallReturn kicker
Called from the events of captive ball objects. All these event are automatically generated with the .CreateEvents method.
Example:
Sub CaptiveTrigger_Hit : cbCaptive.TrigHit ActiveBall : End Sub
Sub CaptiveTrigger_UnHit : cbCaptive.TrigHit 0 : End Sub
Sub CaptiveWall_Hit : cbCaptive.BallHit ActiveBall : End Sub
Sub Captive2_Hit : cbCaptive.BallReturn Me : End Sub




Top













are all trademarks of VPFORUMS.