SoccerFun-0.3.3: Football simulation framework for teaching functional programming

SoccerFun.Ball

Synopsis

Documentation

data BallState Source

Constructors

Free Ball 
GainedBy PlayerID 

Instances

data Ball Source

Constructors

Ball 

Instances

mkBall :: Position -> Speed -> BallSource

mkBall returns a ball with 3D dimensions.

ballIsFree :: BallState -> BoolSource

ballIsFree yields True iff argument is (Free ...).

ballAtCenter :: Field -> BallSource

ballAtCenter returns a non-moving ball at the center of the ball field.

ballIsGainedBy :: PlayerID -> BallState -> BoolSource

ballIsGainedBy yields True iff the ball is in possession by the given player.

data BounceDirection Source

Constructors

Down 
Up 
Forward 
Back 

bounceBall :: BounceDirection -> (Speed3D, StdGen) -> (Speed3D, StdGen)Source

Function used for giving a new random direction towards the given BounceDirection (#param1)

radiusBallSource

Arguments

:: Float

officially it should be 0.113m, but that turns out to be too small for rendering

surfaceResistanceSource

Arguments

:: Float

maximum speed of ball when moving over surface

airResistanceSource

Arguments

:: Float

maximum speed of ball when moving through air (should depend on velocity)

accellerationSecSource

Arguments

:: Float

acceleration difference per square second