Show
Ignore:
Timestamp:
10/05/08 16:27:31 (3 months ago)
Author:
mokehehe
Message:

エフェクトオブジェクト(コイン取得、スコア加算、ブロック破壊)追加

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/haskell/nario/Player.hs

    r20691 r20775  
    77        updatePlayer, 
    88        renderPlayer, 
     9        playerGetCoin, 
     10        addScore, 
    911        getScrollPos, 
    1012        getPlayerYPos, 
    1113        getPlayerVY, 
    1214        getPlayerHitRect, 
    13         getPlayerMedal, 
     15        getPlayerCoin, 
    1416        getPlayerScore, 
    1517        getPlayerType, 
     
    6163        undeadCount :: Int, 
    6264 
    63         medal :: Int, 
     65        coin :: Int, 
    6466        score :: Int, 
    6567 
     
    8082        undeadCount = 0, 
    8183 
    82         medal = 0, 
     84        coin = 0, 
    8385        score = 0, 
    8486 
     
    206208checkCeil fld self 
    207209        | 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)]) 
    209211        where 
    210212                yofs = case pltype self of 
    211                         SmallNario      -> 15 
    212                         SuperNario      -> 30 
    213                         FireNario       -> 30 
     213                        SmallNario      -> 14 
     214                        SuperNario      -> 28 
     215                        FireNario       -> 28 
    214216                ytmp = y self - yofs * one 
    215217 
     
    218220                isCeil = isBlock $ fieldRef fld cx cy 
    219221                yground y = (cellCrd y) * (chrSize * one) 
     222                y' = ((cy + 1) * chrSize + yofs) * one 
    220223 
    221224 
     
    267270                yy = y self `div` one 
    268271 
    269 -- メダル枚数取得 
    270 getPlayerMedal :: Player -> Int 
    271 getPlayerMedal = medal 
     272-- コイン枚数取得 
     273getPlayerCoin :: Player -> Int 
     274getPlayerCoin = coin 
    272275 
    273276-- スコア取得 
     
    293296stampPlayer :: Player -> Player 
    294297stampPlayer self = self { vy = stampVy } 
     298 
     299-- コイン取得 
     300playerGetCoin :: Player -> Player 
     301playerGetCoin self = self { coin = (coin self + 1) `mod` 100 } 
     302 
     303-- スコア加算 
     304addScore :: Int -> Player -> Player 
     305addScore a self = self { score = score self + a } 
    295306 
    296307-- 描画