freezy / freezy/VisualPinball.Engine

Add Flipper Rubber Dampening when Flipper is in Up-Position

Open
#438 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted physics
Dominant language
C#
Stars
508
Forks
73
Avg merge
43m
Merged PRs (30d)
3

Description

Flippers on newest VPW-Releases have some dampening **(only if Flipper is held up and no live catch happened)** and when abs(velx) < 2 and vely < 0 and vely > -3.75

This should be implemented.

```
'######################### Add new FlippersD Profile
'######################### Adjust these values to increase or lessen the elasticity

dim FlippersD : Set FlippersD = new Dampener
FlippersD.name = "Flippers"
FlippersD.debugOn = False
FlippersD.Print = False
FlippersD.addpoint 0, 0, 1.1
FlippersD.addpoint 1, 3.77, 0.99
FlippersD.addpoint 2, 6, 0.99

'######################### Add Dampenf to Dampener Class
'######################### Only applies dampener when abs(velx) < 2 and vely < 0 and vely > -3.75

public sub Dampenf(aBall, parm)
dim RealCOR, DesiredCOR, str, coef
DesiredCor = LinearEnvelope(cor.ballvel(aBall.id), ModIn, ModOut )
RealCOR = BallSpeed(aBall) / cor.ballvel(aBall.id)
coef = desiredcor / realcor
If abs(aball.velx) < 2 and aball.vely < 0 and aball.vely > -3.75 then
aBall.velx = aBall.velx * coef : aBall.vely = aBall.vely * coef
End If
End Sub
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.