Changeset 20680
- Timestamp:
- 10/04/08 16:01:22 (3 months ago)
- Location:
- lang/haskell/nario
- Files:
-
- 1 added
- 8 modified
-
Actor.hs (modified) (2 diffs)
-
Actor/Flower.hs (added)
-
Actor/Kinoko.hs (modified) (2 diffs)
-
Actor/Nokonoko.hs (modified) (1 diff)
-
Event.hs (modified) (1 diff)
-
Images.hs (modified) (1 diff)
-
Main.hs (modified) (4 diffs)
-
Player.hs (modified) (13 diffs)
-
README.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/haskell/nario/Actor.hs
r20673 r20680 14 14 import AppUtil (ImageResource, Rect) 15 15 import Field (Field) 16 import Player (Player) 16 17 17 18 … … 25 26 getHitRect :: a -> Maybe Rect 26 27 getHitRect _ = Nothing 28 29 onHit :: Player -> a -> (Player, Maybe a) 30 onHit pl ac = (pl, Nothing) 27 31 28 32 -- ============================================================================ -
lang/haskell/nario/Actor/Kinoko.hs
r20673 r20680 13 13 import Images 14 14 import Field 15 import Player (PlayerType(..), getPlayerType, setPlayerType) 15 16 16 17 maxVy = one * 6 … … 52 53 yy = y self `div` one 53 54 55 onHit pl self = (setPlayerType nt pl, Nothing) 56 where 57 nt = case typ of 58 SmallNario -> SuperNario 59 otherwise -> typ 60 typ = getPlayerType pl 61 54 62 55 63 newKinoko :: Int -> Int -> Kinoko -
lang/haskell/nario/Actor/Nokonoko.hs
r20670 r20680 28 28 return () 29 29 where 30 imgtype = ImgNoko030 imgtype = [ImgNoko0, ImgNoko1] !! (cnt self `mod` 16 `div` 8) 31 31 32 32 newNokonoko :: Int -> Int -> Nokonoko -
lang/haskell/nario/Event.hs
r20670 r20680 6 6 7 7 data Event = 8 -- ブロックをたたいた 9 EvHitBlock ImageType Int Int 8 -- ブロックをたたいた x y super? 9 EvHitBlock ImageType Int Int Bool 10 10 11 11 -- フィールドを変更 -
lang/haskell/nario/Images.hs
r20670 r20680 1 1 module Images (ImageType(..), imageTypes, imageFn) where 2 2 import Maybe (fromJust) 3 data ImageType = ImgBlock1 | ImgBlock2 | ImgBlock3 | ImgBlock4 | ImgBlock5 | ImgCloud00 | ImgCloud01 | ImgCloud02 | ImgCloud10 | ImgCloud11 | ImgCloud12 | ImgDk00 | ImgDk01 | ImgDk10 | ImgDk11 | ImgFlag | ImgF ont | ImgGrass0 | ImgGrass1 | ImgGrass2 | ImgKinoko | ImgKuri0 | ImgKuri1 | ImgMt02 | ImgMt11 | ImgMt12 | ImgMt13 | ImgMt22 | ImgNarioDie | ImgNarioLJump | ImgNarioLSlip | ImgNarioLStand | ImgNarioLWalk1 | ImgNarioLWalk2 | ImgNarioLWalk3 | ImgNarioRJump | ImgNarioRSlip | ImgNarioRStand | ImgNarioRWalk1 | ImgNarioRWalk2 | ImgNarioRWalk3 | ImgNoko0 | ImgPole0 | ImgPole1 | ImgSnarioLJump | ImgSnarioLStand | ImgSnarioLWalk1 | ImgSnarioLWalk2 | ImgSnarioLWalk3 | ImgSnarioRJump | ImgSnarioRStand | ImgSnarioRWalk1 | ImgSnarioRWalk2 | ImgSnarioRWalk3 | ImgTitle deriving (Eq)4 imageTypes = [ImgBlock1, ImgBlock2, ImgBlock3, ImgBlock4, ImgBlock5, ImgCloud00, ImgCloud01, ImgCloud02, ImgCloud10, ImgCloud11, ImgCloud12, ImgDk00, ImgDk01, ImgDk10, ImgDk11, ImgFlag, ImgF ont, ImgGrass0, ImgGrass1, ImgGrass2, ImgKinoko, ImgKuri0, ImgKuri1, ImgMt02, ImgMt11, ImgMt12, ImgMt13, ImgMt22, ImgNarioDie, ImgNarioLJump, ImgNarioLSlip, ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioRJump, ImgNarioRSlip, ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNoko0, ImgPole0, ImgPole1, ImgSnarioLJump, ImgSnarioLStand, ImgSnarioLWalk1, ImgSnarioLWalk2, ImgSnarioLWalk3, ImgSnarioRJump, ImgSnarioRStand, ImgSnarioRWalk1, ImgSnarioRWalk2, ImgSnarioRWalk3, ImgTitle]5 imageFilenames = ["block1.bmp", "block2.bmp", "block3.bmp", "block4.bmp", "block5.bmp", "cloud00.bmp", "cloud01.bmp", "cloud02.bmp", "cloud10.bmp", "cloud11.bmp", "cloud12.bmp", "dk00.bmp", "dk01.bmp", "dk10.bmp", "dk11.bmp", "flag.bmp", "f ont.bmp", "grass0.bmp", "grass1.bmp", "grass2.bmp", "kinoko.bmp", "kuri0.bmp", "kuri1.bmp", "mt02.bmp", "mt11.bmp", "mt12.bmp", "mt13.bmp", "mt22.bmp", "narioDie.bmp", "narioLJump.bmp", "narioLSlip.bmp", "narioLStand.bmp", "narioLWalk1.bmp", "narioLWalk2.bmp", "narioLWalk3.bmp", "narioRJump.bmp", "narioRSlip.bmp", "narioRStand.bmp", "narioRWalk1.bmp", "narioRWalk2.bmp", "narioRWalk3.bmp", "noko0.bmp", "pole0.bmp", "pole1.bmp", "snarioLJump.bmp", "snarioLStand.bmp", "snarioLWalk1.bmp", "snarioLWalk2.bmp", "snarioLWalk3.bmp", "snarioRJump.bmp", "snarioRStand.bmp", "snarioRWalk1.bmp", "snarioRWalk2.bmp", "snarioRWalk3.bmp", "title.bmp"]3 data ImageType = ImgBlock1 | ImgBlock2 | ImgBlock3 | ImgBlock4 | ImgBlock5 | ImgCloud00 | ImgCloud01 | ImgCloud02 | ImgCloud10 | ImgCloud11 | ImgCloud12 | ImgDk00 | ImgDk01 | ImgDk10 | ImgDk11 | ImgFlag | ImgFlower | ImgFNarioLJump | ImgFNarioLShot | ImgFNarioLSit | ImgFNarioLSlip | ImgFNarioLStand | ImgFNarioLWalk1 | ImgFNarioLWalk2 | ImgFNarioLWalk3 | ImgFNarioRJump | ImgFNarioRShot | ImgFNarioRSit | ImgFNarioRSlip | ImgFNarioRStand | ImgFNarioRWalk1 | ImgFNarioRWalk2 | ImgFNarioRWalk3 | ImgFont | ImgGrass0 | ImgGrass1 | ImgGrass2 | ImgKinoko | ImgKuri0 | ImgKuri1 | ImgMt02 | ImgMt11 | ImgMt12 | ImgMt13 | ImgMt22 | ImgNarioDie | ImgNarioLJump | ImgNarioLSlip | ImgNarioLStand | ImgNarioLWalk1 | ImgNarioLWalk2 | ImgNarioLWalk3 | ImgNarioRJump | ImgNarioRSlip | ImgNarioRStand | ImgNarioRWalk1 | ImgNarioRWalk2 | ImgNarioRWalk3 | ImgNoko0 | ImgNoko1 | ImgPole0 | ImgPole1 | ImgSNarioLJump | ImgSNarioLSit | ImgSNarioLSlip | ImgSNarioLStand | ImgSNarioLWalk1 | ImgSNarioLWalk2 | ImgSNarioLWalk3 | ImgSNarioRJump | ImgSNarioRSit | ImgSNarioRSlip | ImgSNarioRStand | ImgSNarioRWalk1 | ImgSNarioRWalk2 | ImgSNarioRWalk3 | ImgTitle deriving (Eq) 4 imageTypes = [ImgBlock1, ImgBlock2, ImgBlock3, ImgBlock4, ImgBlock5, ImgCloud00, ImgCloud01, ImgCloud02, ImgCloud10, ImgCloud11, ImgCloud12, ImgDk00, ImgDk01, ImgDk10, ImgDk11, ImgFlag, ImgFlower, ImgFNarioLJump, ImgFNarioLShot, ImgFNarioLSit, ImgFNarioLSlip, ImgFNarioLStand, ImgFNarioLWalk1, ImgFNarioLWalk2, ImgFNarioLWalk3, ImgFNarioRJump, ImgFNarioRShot, ImgFNarioRSit, ImgFNarioRSlip, ImgFNarioRStand, ImgFNarioRWalk1, ImgFNarioRWalk2, ImgFNarioRWalk3, ImgFont, ImgGrass0, ImgGrass1, ImgGrass2, ImgKinoko, ImgKuri0, ImgKuri1, ImgMt02, ImgMt11, ImgMt12, ImgMt13, ImgMt22, ImgNarioDie, ImgNarioLJump, ImgNarioLSlip, ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioRJump, ImgNarioRSlip, ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNoko0, ImgNoko1, ImgPole0, ImgPole1, ImgSNarioLJump, ImgSNarioLSit, ImgSNarioLSlip, ImgSNarioLStand, ImgSNarioLWalk1, ImgSNarioLWalk2, ImgSNarioLWalk3, ImgSNarioRJump, ImgSNarioRSit, ImgSNarioRSlip, ImgSNarioRStand, ImgSNarioRWalk1, ImgSNarioRWalk2, ImgSNarioRWalk3, ImgTitle] 5 imageFilenames = ["block1.bmp", "block2.bmp", "block3.bmp", "block4.bmp", "block5.bmp", "cloud00.bmp", "cloud01.bmp", "cloud02.bmp", "cloud10.bmp", "cloud11.bmp", "cloud12.bmp", "dk00.bmp", "dk01.bmp", "dk10.bmp", "dk11.bmp", "flag.bmp", "flower.bmp", "fNarioLJump.bmp", "fNarioLShot.bmp", "fNarioLSit.bmp", "fNarioLSlip.bmp", "fNarioLStand.bmp", "fNarioLWalk1.bmp", "fNarioLWalk2.bmp", "fNarioLWalk3.bmp", "fNarioRJump.bmp", "fNarioRShot.bmp", "fNarioRSit.bmp", "fNarioRSlip.bmp", "fNarioRStand.bmp", "fNarioRWalk1.bmp", "fNarioRWalk2.bmp", "fNarioRWalk3.bmp", "font.bmp", "grass0.bmp", "grass1.bmp", "grass2.bmp", "kinoko.bmp", "kuri0.bmp", "kuri1.bmp", "mt02.bmp", "mt11.bmp", "mt12.bmp", "mt13.bmp", "mt22.bmp", "narioDie.bmp", "narioLJump.bmp", "narioLSlip.bmp", "narioLStand.bmp", "narioLWalk1.bmp", "narioLWalk2.bmp", "narioLWalk3.bmp", "narioRJump.bmp", "narioRSlip.bmp", "narioRStand.bmp", "narioRWalk1.bmp", "narioRWalk2.bmp", "narioRWalk3.bmp", "noko0.bmp", "noko1.bmp", "pole0.bmp", "pole1.bmp", "sNarioLJump.bmp", "sNarioLSit.bmp", "sNarioLSlip.bmp", "sNarioLStand.bmp", "sNarioLWalk1.bmp", "sNarioLWalk2.bmp", "sNarioLWalk3.bmp", "sNarioRJump.bmp", "sNarioRSit.bmp", "sNarioRSlip.bmp", "sNarioRStand.bmp", "sNarioRWalk1.bmp", "sNarioRWalk2.bmp", "sNarioRWalk3.bmp", "title.bmp"] 6 6 imageFn = fromJust . flip lookup (zip imageTypes imageFilenames) -
lang/haskell/nario/Main.hs
r20673 r20680 22 22 import Actor.Nokonoko 23 23 import Actor.Kinoko 24 import Actor.Flower 24 25 25 26 -- 背景色 … … 140 141 nothingHappened = (pl, ac ++ [ActorWrapper a]) 141 142 plrc = getPlayerHitRect player 142 pl' = pl 143 ac' = ac 143 (pl', a') = onHit pl a 144 ac' = case a' of 145 Just a'' -> ac ++ [ActorWrapper a''] 146 Nothing -> ac 144 147 145 148 … … 186 189 procEvent gs ev = foldl proc gs ev 187 190 where 188 proc gs (EvHitBlock imgtype cx cy) 189 | hardBlock c = gs 190 | otherwise = gs { fld = fld', actors = actors' } 191 proc gs (EvHitBlock imgtype cx cy bSuper) 192 | hardBlock c = gs 193 | bSuper && breakable c = gs { fld = fieldSet (fld gs) cx cy ' ' } 194 | otherwise = gs { fld = fld', actors = actors' } 191 195 where 192 196 c = fieldRef (fld gs) cx cy 193 197 items 194 | c == 'K' = [ActorWrapper $ newKinokocx cy]198 | c == 'K' = if not bSuper then [ActorWrapper $ newKinoko cx cy] else [ActorWrapper $ newFlower cx cy] 195 199 | otherwise = [] 196 200 actors' = actors gs ++ [ActorWrapper $ newAnimBlock cx cy $ fieldRef (fld gs) cx cy] ++ items 197 201 fld' = fieldSet (fld gs) cx cy '*' 202 breakable c = c == 'O' 198 203 proc gs (EvSetField cx cy c) = gs { fld = fieldSet (fld gs) cx cy c } 199 204 proc gs (EvAppearEnemy cx cy c) = gs { actors = actors gs ++ [ene] } … … 213 218 renderField sur imgres scrx (fld gs) 214 219 renderInfo gs imgres sur 220 renderActors imgres scrx sur (actors gs) 215 221 renderPlayer sur imgres scrx (pl gs) 216 222 217 renderActors imgres scrx sur (actors gs)218 223 return () 219 224 -
lang/haskell/nario/Player.hs
r20673 r20680 3 3 module Player ( 4 4 Player(..), 5 PlayerType(..), 5 6 newPlayer, 6 7 updatePlayer, … … 10 11 getPlayerHitRect, 11 12 getPlayerMedal, 12 getPlayerScore 13 getPlayerScore, 14 getPlayerType, 15 setPlayerType 13 16 ) where 14 17 … … 32 35 gravity2 = one `div` 4 -- Aを長押ししたときの重力 33 36 37 data PlayerType = SmallNario | SuperNario | FireNario 38 deriving (Eq) 39 34 40 data Player = Player { 41 pltype :: PlayerType, 35 42 x :: Int, 36 43 y :: Int, … … 49 56 50 57 newPlayer = Player { 58 pltype = SmallNario, 51 59 x = 3 * chrSize * one, 52 60 y = 13 * chrSize * one, … … 70 78 patJump = patWalk + walkPatNum 71 79 patSlip = patJump + 1 72 73 imgTable = [ 74 [ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioLJump, ImgNarioLSlip], 75 [ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNarioRJump, ImgNarioRSlip] 80 patSit = patSlip + 1 81 patShot = patSit + 1 82 83 imgTableSmall = [ 84 [ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioLJump, ImgNarioLSlip, ImgNarioLStand], 85 [ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNarioRJump, ImgNarioRSlip, ImgNarioRStand] 86 ] 87 imgTableSuper = [ 88 [ImgSNarioLStand, ImgSNarioLWalk1, ImgSNarioLWalk2, ImgSNarioLWalk3, ImgSNarioLJump, ImgSNarioLSlip, ImgSNarioLSit], 89 [ImgSNarioRStand, ImgSNarioRWalk1, ImgSNarioRWalk2, ImgSNarioRWalk3, ImgSNarioRJump, ImgSNarioRSlip, ImgSNarioRSit] 90 ] 91 imgTableFire = [ 92 [ImgFNarioLStand, ImgFNarioLWalk1, ImgFNarioLWalk2, ImgFNarioLWalk3, ImgFNarioLJump, ImgFNarioLSlip, ImgFNarioLSit, ImgFNarioLShot], 93 [ImgFNarioRStand, ImgFNarioRWalk1, ImgFNarioRWalk2, ImgFNarioRWalk3, ImgFNarioRJump, ImgFNarioRSlip, ImgFNarioRSit, ImgFNarioRShot] 76 94 ] 77 95 … … 79 97 -- 横移動 80 98 moveX :: KeyProc -> Player -> Player 81 moveX kp player=82 if (stand player)83 then player' { lr = lr', pat = pat', anm = anm' }84 else player'99 moveX kp self = 100 if (stand self) 101 then self' { lr = lr', pat = pat', anm = anm' } 102 else self' 85 103 where 86 104 ax = (-padl + padr) * acc 87 105 vx' 88 | ax /= 0 = rangeadd (vx player) ax (-maxspd) maxspd89 | stand player = friction (vx player) acc90 | otherwise = vx player91 x' = max xmin $ (x player) + vx'106 | ax /= 0 = rangeadd (vx self) ax (-maxspd) maxspd 107 | stand self = friction (vx self) acc 108 | otherwise = vx self 109 x' = max xmin $ (x self) + vx' 92 110 scrx' 93 | vx' > 0 && (x' - (scrx player)) `div` one > scrollPos = (scrx player) + vx'94 | otherwise = (scrx player)111 | vx' > 0 && (x' - (scrx self)) `div` one > scrollPos = (scrx self) + vx' 112 | otherwise = (scrx self) 95 113 96 114 scrollPos = (max vx' 0) * (scrollMaxX - scrollMinX) `div` runVx + scrollMinX … … 99 117 padr = if isPressed (kp PadR) then 1 else 0 100 118 maxspd 101 | not $ stand player= walkVx `div` 2119 | not $ stand self = walkVx `div` 2 102 120 | isPressed (kp PadB) = walkVx * 2 103 121 | otherwise = walkVx 104 xmin = (scrx player) + chrSize `div` 2 * one105 106 player' = player{ x = x', vx = vx', scrx = scrx' }122 xmin = (scrx self) + chrSize `div` 2 * one 123 124 self' = self { x = x', vx = vx', scrx = scrx' } 107 125 108 126 lr' = 109 127 case (-padl + padr) of 110 0 -> lr player128 0 -> lr self 111 129 -1 -> 0 112 130 1 -> 1 … … 118 136 anm' 119 137 | vx' == 0 = 0 120 | otherwise = ((anm player) + (abs vx')) `mod` (walkPatNum * anmCnt)138 | otherwise = ((anm self) + (abs vx')) `mod` (walkPatNum * anmCnt) 121 139 anmCnt = walkVx * 3 122 140 … … 124 142 -- 横移動チェック 125 143 checkX :: Field -> Player -> Player 126 checkX fld player127 | dir == 0 = check (-1) $ check 1 $ player128 | otherwise = check dir $ player129 where 130 dir = sgn $ vx player131 check dx player132 | isBlock $ fieldRef fld cx cy = player { x = (x player) - dx * one, vx = 0 }133 | otherwise = player144 checkX fld self 145 | dir == 0 = check (-1) $ check 1 $ self 146 | otherwise = check dir $ self 147 where 148 dir = sgn $ vx self 149 check dx self 150 | isBlock $ fieldRef fld cx cy = self { x = (x self) - dx * one, vx = 0 } 151 | otherwise = self 134 152 where 135 cx = cellCrd (x player+ ofsx dx)136 cy = cellCrd (y player- chrSize `div` 2 * one)153 cx = cellCrd (x self + ofsx dx) 154 cy = cellCrd (y self - chrSize `div` 2 * one) 137 155 ofsx (-1) = -6 * one 138 156 ofsx 1 = 5 * one … … 141 159 -- 重力による落下 142 160 fall :: KeyProc -> Player -> Player 143 fall kp player144 | stand player = player145 | otherwise = player{ y = y', vy = vy' }161 fall kp self 162 | stand self = self 163 | otherwise = self { y = y', vy = vy' } 146 164 where 147 165 ay 148 | vy player< 0 && isPressed (kp PadA) = gravity2166 | vy self < 0 && isPressed (kp PadA) = gravity2 149 167 | otherwise = gravity 150 vy' = min maxVy $ vy player+ ay151 y' = y player+ vy'168 vy' = min maxVy $ vy self + ay 169 y' = y self + vy' 152 170 153 171 154 172 -- 床をチェック 155 173 checkFloor :: Field -> Player -> Player 156 checkFloor fld player157 | stand' = player{ stand = stand', y = ystand, vy = 0 }158 | otherwise = player{ stand = stand' }174 checkFloor fld self 175 | stand' = self { stand = stand', y = ystand, vy = 0 } 176 | otherwise = self { stand = stand' } 159 177 where 160 178 stand' 161 | vy player>= 0 = isGround (-6) || isGround 5162 | otherwise = stand player163 ystand = (cellCrd $ y player) * (chrSize * one)164 165 isGround ofsx = isBlock $ fieldRef fld (cellCrd $ x player + ofsx * one) (cellCrd (y player))179 | vy self >= 0 = isGround (-6) || isGround 5 180 | otherwise = stand self 181 ystand = (cellCrd $ y self) * (chrSize * one) 182 183 isGround ofsx = isBlock $ fieldRef fld (cellCrd $ x self + ofsx * one) (cellCrd (y self)) 166 184 167 185 -- 上をチェック 168 186 checkCeil :: Field -> Player -> (Player, [Event]) 169 checkCeil fld player 170 | stand player || vy player >= 0 || not isCeil = (player, []) 171 | otherwise = (player { vy = 0, score = (score player) + 10 }, [EvHitBlock ImgBlock2 cx cy]) 172 where 173 ytmp = y player - one * chrSize 174 175 cx = cellCrd $ x player 187 checkCeil fld self 188 | stand self || vy self >= 0 || not isCeil = (self, []) 189 | otherwise = (self { vy = 0, score = (score self) + 10 }, [EvHitBlock ImgBlock2 cx cy (pltype self /= SmallNario)]) 190 where 191 yofs = case pltype self of 192 SmallNario -> 15 193 SuperNario -> 30 194 FireNario -> 30 195 ytmp = y self - yofs * one 196 197 cx = cellCrd $ x self 176 198 cy = cellCrd ytmp 177 199 isCeil = isBlock $ fieldRef fld cx cy … … 181 203 -- ジャンプする? 182 204 doJump :: KeyProc -> Player -> Player 183 doJump kp player184 | stand player && kp PadA == Pushed = player{ vy = jumpVy, stand = False, pat = patJump }185 | otherwise = player205 doJump kp self 206 | stand self && kp PadA == Pushed = self { vy = jumpVy, stand = False, pat = patJump } 207 | otherwise = self 186 208 187 209 188 210 -- 更新処理 189 211 updatePlayer :: KeyProc -> Field -> Player -> (Player, [Event]) 190 updatePlayer kp fld player=191 moveY $ checkX fld $ moveX kp player212 updatePlayer kp fld self = 213 moveY $ checkX fld $ moveX kp self 192 214 where 193 215 moveY = checkCeil fld . doJump kp . checkFloor fld . fall kp … … 195 217 -- スクロール位置取得 196 218 getScrollPos :: Player -> Int 197 getScrollPos player = (scrx player) `div` one219 getScrollPos self = (scrx self) `div` one 198 220 199 221 -- Y座標取得 … … 216 238 getPlayerScore = score 217 239 240 -- タイプ取得 241 getPlayerType :: Player -> PlayerType 242 getPlayerType = pltype 243 244 -- タイプ設定 245 setPlayerType :: PlayerType -> Player -> Player 246 setPlayerType t self = self { pltype = t } 247 218 248 -- 描画 219 renderPlayer sur imgres scrx player= do249 renderPlayer sur imgres scrx self = do 220 250 blitSurface (getImageSurface imgres imgtype) Nothing sur pos 221 251 where 222 pos = pt ((x player) `div` one - chrSize `div` 2 - scrx) ((y player) `div` one - chrSize+1 - 8) 223 imgtype = imgTable !! (lr player) !! (pat player) 252 pos = case pltype self of 253 SmallNario -> pt sx $ sy - chrSize + 1 254 otherwise -> pt sx $ sy - chrSize * 2 + 1 255 imgtype = imgtbl !! lr self !! pat self 256 imgtbl = case pltype self of 257 SmallNario -> imgTableSmall 258 SuperNario -> imgTableSuper 259 FireNario -> imgTableFire 260 sx = x self `div` one - chrSize `div` 2 - scrx 261 sy = y self `div` one - 8 -
lang/haskell/nario/README.txt
r20661 r20680 5 5 を Haskell/HSDL で作る 6 6 7 8 7 HSDL 9 8 http://fxp.hp.infoseek.co.jp/haskell/HSDL/ 9 10 10 11 11 … … 33 33 34 34 35 ★ビルド 36 ・必要なもの 37 Haskell コンパイラ 38 39 SDL 40 http://www.libsdl.org/ 41 42 HSDL 43 http://fxp.hp.infoseek.co.jp/haskell/HSDL/ 44 45 ○ビルド 46 make 47 48 ○実行 49 できた実行ファイルを入力、または 50 make run 35 51 36 52
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)