diff options
author | lukasepple <git@lukasepple.de> | 2015-12-05 17:35:34 +0100 |
---|---|---|
committer | lukasepple <git@lukasepple.de> | 2015-12-05 17:35:34 +0100 |
commit | 9ba16321fd0727d95174d46c051b82f54d0dd920 (patch) | |
tree | 26c4fbd828cc1f049ac3b6191b32750cbbf8667c | |
parent | 9a53b1c0f6761773276ae2968ac087363a168e07 (diff) |
Added Documentation for the Object type
-rw-r--r-- | grav1ty.hs | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/grav1ty.hs b/grav1ty.hs index 3b0aa47..7f6d530 100644 --- a/grav1ty.hs +++ b/grav1ty.hs @@ -11,17 +11,29 @@ import Control.Lens fps :: Num a => a fps = 30 +-- | Representation of the objects in this simulation. +-- An Object is either a static object or a dynamic +-- object which gets influenced by the gravity force +-- of other objects. +-- Dynamic objects may but don't have to be controlled +-- by an user. Also multiplayer scenarios are possible. +-- By control I mean controlling the manual acceleration +-- _acc. data Object = Static { - _loc :: V2 Float - , _pic :: Picture - , _mass :: Float + _loc :: V2 Float -- ^ location of the object (V2 0 0) is in the centre + -- of the simulation + , _pic :: Picture -- ^ the gloss picture to draw the object + , _mass :: Float -- ^ mass in kilograms } | Dynamic { - _loc :: V2 Float - , _pic :: Picture - , _mass :: Float - , _acc :: V2 Float + _loc :: V2 Float -- ^ location of the object (V2 0 0) is in the centre + -- of the simulation + , _pic :: Picture -- ^ the gloss picture to draw the object + , _mass :: Float -- ^ mass in kilograms + , _acc :: V2 Float -- ^ current manual acceleration of the object. Think of + -- this as the acceleration caused by a spaceship's + -- thrusters or similar. } deriving (Eq, Show) makeLenses ''Object |