diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-03-08 22:13:35 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-03-08 22:13:35 +0100 |
commit | 335c10654f7d41053ffcabed19cb003d1c0ce13e (patch) | |
tree | b1b6e0bf7582206c3953492a0407a5120ca9ff75 /Game.hs | |
parent | 7edb7c0e060d509db83287c1cd8389e37dfc3a17 (diff) | |
download | htanks-335c10654f7d41053ffcabed19cb003d1c0ce13e.tar htanks-335c10654f7d41053ffcabed19cb003d1c0ce13e.zip |
Added bullet texture and movement; restructured game state
Diffstat (limited to 'Game.hs')
-rw-r--r-- | Game.hs | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -1,22 +1,45 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} -module Game ( GameState(..) +module Game ( Tank(..) + , Shoot(..) + , GameState(..) , Game , runGame ) where import Level -import Tank import Texture import Control.Monad import Control.Monad.State +import Data.Fixed import qualified Data.Map as M +data Tank = Tank + { posx :: !Micro + , posy :: !Micro + , dir :: !Micro + , aim :: !Micro + , speed :: !Micro + , turnspeed :: !Micro + , moving :: !Bool + , tankShootSpeed :: !Micro + , tankShootBounces :: !Int + } deriving Show + +data Shoot = Shoot + { shootX :: !Micro + , shootY :: !Micro + , shootDir :: !Micro + , shootSpeed :: !Micro + , bouncesLeft :: !Int + } deriving Show + data GameState = GameState { level :: !Level , tanks :: ![Tank] + , shoots :: ![Shoot] , textures :: !(M.Map Texture TextureObject) } deriving (Show) |