Show
Ignore:
Timestamp:
10/02/08 01:25:33 (3 months ago)
Author:
mokehehe
Message:

タイトル画面とゲーム中を作成
プレーヤーが画面外に落ちたりタイムアップならゲームオーバー

Files:
1 modified

Legend:

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

    r20397 r20420  
    77        updatePlayer, 
    88        renderPlayer, 
    9         getScrollPos 
     9        getScrollPos, 
     10        getPlayerYPos, 
     11        getPlayerMedal, 
     12        getPlayerScore 
    1013) where 
    1114 
     
    1417import Util 
    1518import AppUtil 
    16 import SDLUtil 
    1719import Const 
    1820import Images 
     
    3739        stand :: Bool, 
    3840 
     41        medal :: Int, 
     42        score :: Int, 
     43 
    3944        lr :: Int, 
    4045        pat :: Int, 
     
    4954        scrx = 0, 
    5055        stand = False, 
     56 
     57        medal = 0, 
     58        score = 0, 
    5159 
    5260        lr = 1, 
     
    160168checkCeil fld player 
    161169        | stand player || vy player >= 0 || not isCeil  = (player, []) 
    162         | otherwise = (player { vy = 0 }, [EvHitBlock ImgBlock2 cx cy]) 
     170        | otherwise = (player { vy = 0, score = (score player) + 10 }, [EvHitBlock ImgBlock2 cx cy]) 
    163171        where 
    164172                ytmp = y player - one * chrSize 
     
    188196getScrollPos player = (scrx player) `div` one 
    189197 
     198-- Y座標取得 
     199getPlayerYPos :: Player -> Int 
     200getPlayerYPos = (`div` one) . y 
     201 
     202-- メダル枚数取得 
     203getPlayerMedal :: Player -> Int 
     204getPlayerMedal = medal 
     205 
     206-- スコア取得 
     207getPlayerScore :: Player -> Int 
     208getPlayerScore = score 
     209 
    190210-- 描画 
    191211renderPlayer sur imgres scrx player = do