summaryrefslogtreecommitdiffstats
path: root/Game.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-03-08 22:13:35 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-03-08 22:13:35 +0100
commit335c10654f7d41053ffcabed19cb003d1c0ce13e (patch)
treeb1b6e0bf7582206c3953492a0407a5120ca9ff75 /Game.hs
parent7edb7c0e060d509db83287c1cd8389e37dfc3a17 (diff)
downloadhtanks-335c10654f7d41053ffcabed19cb003d1c0ce13e.tar
htanks-335c10654f7d41053ffcabed19cb003d1c0ce13e.zip
Added bullet texture and movement; restructured game state
Diffstat (limited to 'Game.hs')
-rw-r--r--Game.hs27
1 files changed, 25 insertions, 2 deletions
diff --git a/Game.hs b/Game.hs
index 9097bca..c782465 100644
--- a/Game.hs
+++ b/Game.hs
@@ -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)