summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--HTanks.hs14
-rw-r--r--Makefile13
-rw-r--r--Setup.lhs3
-rw-r--r--htanks.cabal17
5 files changed, 28 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 74f3efd..733412c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,2 @@
-*.hi
-*.o
*~
-*.chs.h
-Bindings/*.hs
-
-HTanks
+dist
diff --git a/HTanks.hs b/HTanks.hs
index 1937693..5e980fc 100644
--- a/HTanks.hs
+++ b/HTanks.hs
@@ -165,13 +165,13 @@ simulationStep = do
shootingtanks = map (\(tank, _, n) -> (tank, n)) $ filter (\(tank, shoot, _) -> shoot && (shootsLeft tank) > 0) $ ts
newtanks = map (\(tank, shoot, _) -> if shoot then tank {shootsLeft = (shootsLeft tank) - 1} else tank) $ ts
newshoots = map (\(tank, n) -> Shoot
- { shootX = posx tank
- , shootY = posy tank
- , shootDir = aim tank
- , shootSpeed = tankShootSpeed tank
- , bouncesLeft = tankShootBounces tank
- , shootTank = n
- }) shootingtanks
+ { shootX = posx tank
+ , shootY = posy tank
+ , shootDir = aim tank
+ , shootSpeed = tankShootSpeed tank
+ , bouncesLeft = tankShootBounces tank
+ , shootTank = n
+ }) shootingtanks
modify $ \state -> state {players = p}
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 8cb0488..0000000
--- a/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-HSCFILES = Bindings/GLX.hsc Bindings/GLPng.hsc
-HSFILES = $(HSCFILES:%.hsc=%.hs) GLDriver.hs GLX.hs Texture.hs Player.hs DefaultPlayer.hs CPUPlayer.hs Level.hs Game.hs Render.hs HTanks.hs
-
-all: HTanks
-
-HTanks : $(HSFILES)
- ghc -threaded --make HTanks -lGL -lglpng
-
-%.hs : %.hsc
- hsc2hs $<
-
-clean :
- rm -f HTanks $(HSFILES:%.hs=%.o) $(HSFILES:%.hs=%.hi) $(HSCFILES:%.hsc=%.hs)
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
index 0000000..5bde0de
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,3 @@
+#!/usr/bin/env runhaskell
+> import Distribution.Simple
+> main = defaultMain
diff --git a/htanks.cabal b/htanks.cabal
new file mode 100644
index 0000000..18572b6
--- /dev/null
+++ b/htanks.cabal
@@ -0,0 +1,17 @@
+name: htanks
+version: 0.0
+synopsis: <Project description>
+description: <Project description>
+category: Game
+license: GPL-3
+license-file: LICENSE
+author: Matthias Schiffer
+maintainer: matthias@gamezock.de
+build-depends: base >= 4, syb, containers, mtl, time, X11, OpenGL
+build-type: Simple
+
+executable: HTanks
+main-is: HTanks.hs
+other-modules: Bindings.GLX, Bindings.GLPng
+ghc-options: -threaded
+extra-libraries: glpng