12 setFire
:: Bool -> Player
-> Player
13 setFire tf pl
= pl
{ fire
= tf
}
15 addDir
:: (Int,Int) -> Player
-> Player
16 addDir
(dx
,dy
) pl
= pl
{ dir
= (x
',y
') } where
17 (x
',y
') = (clamp
(x
+dy
), clamp
(y
+dy
))
21 subDir
:: (Int,Int) -> Player
-> Player
22 subDir dxdy pl
= addDir
(-dxdy
) pl
24 incShots pl
= pl
{ shots
= succ (shots pl
) }
25 decShots pl
= pl
{ shots
= pred (shots pl
) }
26 incLives pl
= pl
{ lives
= succ (lives pl
) }
27 decLives pl
= pl
{ lives
= pred (lives pl
) }