Changeset 20943 for lang/haskell/nario/Player.hs
- Timestamp:
- 10/08/08 07:34:08 (3 months ago)
- Files:
-
- 1 modified
-
lang/haskell/nario/Player.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/haskell/nario/Player.hs
r20925 r20943 26 26 27 27 import Util 28 import AppUtil (KeyProc, isPressed, PadBtn(..), cellCrd, KeyState(..), getImageSurface, Rect(..), putimg)28 import AppUtil (KeyProc, padPressed, padPressing, PadBtn(..), cellCrd, KeyState(..), getImageSurface, Rect(..), putimg) 29 29 import Const 30 30 import Images … … 132 132 x' = max xmin $ (x self) + vx' 133 133 134 padd = if isPressed (kp PadD)then True else False135 padl = if isPressed (kp PadL)then 1 else 0136 padr = if isPressed (kp PadR)then 1 else 0134 padd = if padPressing kp PadD then True else False 135 padl = if padPressing kp PadL then 1 else 0 136 padr = if padPressing kp PadR then 1 else 0 137 137 maxspd 138 138 | not $ stand self = walkVx `div` 2 139 | isPressed (kp PadB)= runVx139 | padPressing kp PadB = runVx 140 140 | otherwise = walkVx 141 141 nowacc 142 | isPressed (kp PadB)= acc2142 | padPressing kp PadB = acc2 143 143 | otherwise = acc 144 144 xmin = (scrx self + chrSize `div` 2) * one … … 237 237 doJump :: KeyProc -> Player -> Player 238 238 doJump kp self 239 | stand self && kp PadA == Pushed= self { vy = vy', stand = False, pat = patJump }239 | stand self && padPressed kp PadA = self { vy = vy', stand = False, pat = patJump } 240 240 | otherwise = self 241 241 where … … 257 257 moveY $ scroll self $ checkX fld $ moveX kp self 258 258 where 259 moveY = checkCeil fld . doJump kp . checkFloor fld . fall ( isPressed $kp PadA)259 moveY = checkCeil fld . doJump kp . checkFloor fld . fall (padPressing kp PadA) 260 260 261 261 -- 死亡時
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)