Changeset 20775 for lang/haskell/nario/Player.hs
- Timestamp:
- 10/05/08 16:27:31 (3 months ago)
- Files:
-
- 1 modified
-
lang/haskell/nario/Player.hs (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/haskell/nario/Player.hs
r20691 r20775 7 7 updatePlayer, 8 8 renderPlayer, 9 playerGetCoin, 10 addScore, 9 11 getScrollPos, 10 12 getPlayerYPos, 11 13 getPlayerVY, 12 14 getPlayerHitRect, 13 getPlayer Medal,15 getPlayerCoin, 14 16 getPlayerScore, 15 17 getPlayerType, … … 61 63 undeadCount :: Int, 62 64 63 medal:: Int,65 coin :: Int, 64 66 score :: Int, 65 67 … … 80 82 undeadCount = 0, 81 83 82 medal= 0,84 coin = 0, 83 85 score = 0, 84 86 … … 206 208 checkCeil fld self 207 209 | stand self || vy self >= 0 || not isCeil = (self, []) 208 | otherwise = (self { vy = 0, score = (score self) + 10 }, [EvHitBlock ImgBlock2 cx cy (pltype self /= SmallNario)])210 | otherwise = (self { y = y', vy = 0 }, [EvHitBlock ImgBlock2 cx cy (pltype self /= SmallNario)]) 209 211 where 210 212 yofs = case pltype self of 211 SmallNario -> 1 5212 SuperNario -> 30213 FireNario -> 30213 SmallNario -> 14 214 SuperNario -> 28 215 FireNario -> 28 214 216 ytmp = y self - yofs * one 215 217 … … 218 220 isCeil = isBlock $ fieldRef fld cx cy 219 221 yground y = (cellCrd y) * (chrSize * one) 222 y' = ((cy + 1) * chrSize + yofs) * one 220 223 221 224 … … 267 270 yy = y self `div` one 268 271 269 -- メダル枚数取得270 getPlayer Medal:: Player -> Int271 getPlayer Medal = medal272 -- コイン枚数取得 273 getPlayerCoin :: Player -> Int 274 getPlayerCoin = coin 272 275 273 276 -- スコア取得 … … 293 296 stampPlayer :: Player -> Player 294 297 stampPlayer self = self { vy = stampVy } 298 299 -- コイン取得 300 playerGetCoin :: Player -> Player 301 playerGetCoin self = self { coin = (coin self + 1) `mod` 100 } 302 303 -- スコア加算 304 addScore :: Int -> Player -> Player 305 addScore a self = self { score = score self + a } 295 306 296 307 -- 描画
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)