diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 20:55:51 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 20:55:51 +0200 |
commit | cc53496bab9ad2bbfc3fb2868cd10fa46f612e69 (patch) | |
tree | f974028160c90e5a373c3ac38d8d7229c419aaa7 /src/Game.hs | |
parent | 8f1fd98cd69659446b9fdd11c0f3d2b860d779f7 (diff) | |
download | htanks-cc53496bab9ad2bbfc3fb2868cd10fa46f612e69.tar htanks-cc53496bab9ad2bbfc3fb2868cd10fa46f612e69.zip |
Reworked Transform as a type class
Diffstat (limited to 'src/Game.hs')
-rw-r--r-- | src/Game.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Game.hs b/src/Game.hs index 16b04d8..c97b5de 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -8,13 +8,12 @@ module Game ( Bullet(..) import Level import Tank -import Transformable import Vector data Bullet = Bullet { bulletPos :: !Vertex - , bulletDir :: !Vector + , bulletDir :: !Rotation , bulletSpeed :: !Coord , bulletBouncesLeft :: !Int , bulletTank :: !Int @@ -27,7 +26,7 @@ bulletY :: Bullet -> Coord bulletY = vertexY . bulletPos instance Transformable Bullet where - t >< b = b { bulletPos = pos, bulletDir = dir } where + transform t b = b { bulletPos = pos, bulletDir = dir } where pos = t >< bulletPos b dir = t >< bulletDir b |