This repository has been archived on 2025-03-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
htanks/src/CPUPlayer.hs
2010-03-09 03:49:15 +01:00

19 lines
448 B
Haskell

{-# LANGUAGE DeriveDataTypeable #-}
module CPUPlayer ( CPUPlayer(..)
) where
import Data.Fixed
import Data.Ratio ((%))
import Data.Typeable
import GLDriver
import Player
data CPUPlayer = CPUPlayer Micro
deriving (Typeable, Show)
instance Player CPUPlayer where
playerUpdate (CPUPlayer angle) _ = (CPUPlayer (if (angle+0.1) > 180 then angle-359.9 else angle+0.1), Just angle, True, Just (-angle), False)