import Data.WrapAround import Graphics.Gloss.Interface.IO.Game import Lance import Resources import Input import Universe import Display import Step import Unit import Unit.Simple.Turret (Turret) import qualified Unit.Simple.Turret as Turret import ResourceTracker import Sound.ALUT import Data.Maybe import System.IO import Data.List ( intersperse ) import Animation displayMode = InWindow "The Edge" (1024, 768) (0, 0) main = withProgNameAndArgs runALUT $ \progName args -> do universe <- initUniverse distanceModel $= audioDistanceModel -- listenerPosition $= (Vertex3 0 0 0) errs <- get alErrors if not (null errs) then hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ])) else return () playIO displayMode black 20 universe displayUniverse handleInput stepUniverse initUniverse = do rt <- initResources rLevels <- initLevels rt let sArena = head rLevels let wmap = Universe.wrapMap sArena return Universe { arena = sArena { lance = Just (Lance.new rt wmap (wrappoint wmap (0, 0))) } , level = 0 , Universe.levels = rLevels , lives = 3 , delayRemaining = 2.0 , resourceTracker = rt , skipLevel = False , levelMessageTimer = Nothing , panelActivationTimer = 0.0 , startGameTimer = 0.0 , queueBlipSound = True , blipSoundSource = Nothing }