Added Transformable class to simplify collision calculation

This commit is contained in:
Matthias Schiffer 2011-06-24 21:50:32 +02:00
parent d7971385e8
commit 83f0606ea9
13 changed files with 258 additions and 144 deletions

View file

@ -20,6 +20,7 @@ import qualified Data.Map as M
import qualified Data.Set as S
import Data.Time
import Vector
main :: IO ()
main = do
@ -30,14 +31,14 @@ main = do
when (initialized gl) $ do
currentTime <- getCurrentTime
let gamestate = GameState {level = theLevel, tanks = [ Tank 7.0 4.0 0 0 1.5 270 False 3 1 5 1
, Tank 4.0 4.0 0 0 1.5 270 False 3 1 5 1
, Tank 10.0 4.0 0 0 1.5 270 False 3 1 5 1
let gamestate = GameState {level = theLevel, tanks = [ Tank (Vertex 7.0 4.0) (Vector 1 0) (Vector 1 0) 1.5 (270*pi/180) False 3 1 5 1
, Tank (Vertex 4.0 4.0) (Vector 1 0) (Vector 1 0) 1.5 (270*pi/180) False 3 1 5 1
, Tank (Vertex 10.0 4.0) (Vector 1 0) (Vector 1 0) 1.5 (270*pi/180) False 3 1 5 1
], bullets = []}
mainstate = MainState {run = True, driver = SomeDriver gl, time = currentTime, players =
[ SomePlayer humanPlayer
, SomePlayer $ CPUPlayer (-90)
, SomePlayer $ CPUPlayer 90
, SomePlayer $ CPUPlayer $ Vector 0 (-1)
, SomePlayer $ CPUPlayer $ Vector 0 1
], textures = M.empty, models = M.empty, gameState = gamestate}
runMain mainstate $ do