Changeset 20223 for lang/haskell
- Timestamp:
- 09/29/08 21:34:45 (2 months ago)
- Location:
- lang/haskell/nario
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/haskell/nario/Const.hs
r20175 r20223 13 13 -- 画像 14 14 data ImageType = 15 ImgNario 00 | ImgNario01 | ImgNario02 | ImgNario03 | ImgNario0416 | ImgNario 10 | ImgNario11 | ImgNario12 | ImgNario13 | ImgNario1415 ImgNarioLStand | ImgNarioLWalk1 | ImgNarioLWalk2 | ImgNarioLWalk3 | ImgNarioLJump 16 | ImgNarioRStand | ImgNarioRWalk1 | ImgNarioRWalk2 | ImgNarioRWalk3 | ImgNarioRJump 17 17 | ImgBlock1 | ImgBlock2 | ImgBlock3 | ImgBlock4 | ImgBlock5 18 18 | ImgMt02 | ImgMt11 | ImgMt12 | ImgMt13 | ImgMt22 … … 21 21 | ImgGrass00 | ImgGrass01 | ImgGrass02 22 22 | ImgFont 23 | ImgTitle 23 24 deriving Eq 24 25 25 26 26 imageFn ImgNario 00 = "nario00.bmp"27 imageFn ImgNario 01 = "nario01.bmp"28 imageFn ImgNario 02 = "nario02.bmp"29 imageFn ImgNario 03 = "nario03.bmp"30 imageFn ImgNario 04 = "nario04.bmp"31 imageFn ImgNario 10 = "nario10.bmp"32 imageFn ImgNario 11 = "nario11.bmp"33 imageFn ImgNario 12 = "nario12.bmp"34 imageFn ImgNario 13 = "nario13.bmp"35 imageFn ImgNario 14 = "nario14.bmp"27 imageFn ImgNarioLStand = "narioLStand.bmp" 28 imageFn ImgNarioLWalk1 = "narioLWalk1.bmp" 29 imageFn ImgNarioLWalk2 = "narioLWalk2.bmp" 30 imageFn ImgNarioLWalk3 = "narioLWalk3.bmp" 31 imageFn ImgNarioLJump = "narioLJump.bmp" 32 imageFn ImgNarioRStand = "narioRStand.bmp" 33 imageFn ImgNarioRWalk1 = "narioRWalk1.bmp" 34 imageFn ImgNarioRWalk2 = "narioRWalk2.bmp" 35 imageFn ImgNarioRWalk3 = "narioRWalk3.bmp" 36 imageFn ImgNarioRJump = "narioRJump.bmp" 36 37 imageFn ImgBlock1 = "block1.bmp" 37 38 imageFn ImgBlock2 = "block2.bmp" … … 58 59 imageFn ImgGrass02 = "grass02.bmp" 59 60 imageFn ImgFont = "font.bmp" 61 imageFn ImgTitle = "title.bmp" 60 62 61 63 images = [ 62 ImgNario 00, ImgNario01, ImgNario02, ImgNario03, ImgNario04,63 ImgNario 10, ImgNario11, ImgNario12, ImgNario13, ImgNario14,64 ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioLJump, 65 ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNarioRJump, 64 66 ImgBlock1, ImgBlock2, ImgBlock3, ImgBlock4, ImgBlock5, 65 67 ImgMt02, ImgMt11, ImgMt12, ImgMt13, ImgMt22, … … 67 69 ImgDk00, ImgDk01, ImgDk10, ImgDk11, 68 70 ImgGrass00, ImgGrass01, ImgGrass02, 69 ImgFont 71 ImgFont, 72 ImgTitle 70 73 ] -
lang/haskell/nario/Field.hs
r20045 r20223 71 71 cellProc _ (_, ' ') = return () 72 72 cellProc y (x, c) = putchr x y c >> return () 73 putchr x y c = blitSurface (getImageSurface imgres $ chr2img c) Nothing sur $ pt (x*chrSize - rx) (y*chrSize )73 putchr x y c = blitSurface (getImageSurface imgres $ chr2img c) Nothing sur $ pt (x*chrSize - rx) (y*chrSize - 8) 74 74 75 75 -- 表示される部分だけ取り出す -
lang/haskell/nario/Main.hs
r20175 r20223 15 15 import Font 16 16 17 wndTitle = " delayed-stream test"17 wndTitle = "NARIO in Haskell" 18 18 wndWidth = 256 19 wndHeight = 2 4019 wndHeight = 224 20 20 wndBpp = 32 21 21 … … 127 127 renderInfo gs imgres sur = do 128 128 puts 3 1 "MARIO" 129 puts 3 2 "00000 "129 puts 3 2 "000000" 130 130 puts 11 2 "?*00" 131 puts 1 91 "WORLD"132 puts 202 "1-1"133 puts 2 61 "TIME"134 puts 2 72 "255"131 puts 18 1 "WORLD" 132 puts 19 2 "1-1" 133 puts 25 1 "TIME" 134 puts 26 2 "255" 135 135 where 136 136 puts = fontPut sur fontsur 137 137 fontsur = getImageSurface imgres ImgFont 138 139 -- タイトル画面 140 renderTitle gs imgres sur = do 141 blitSurface (getImageSurface imgres ImgTitle) Nothing sur (pt (5*8) (3*8)) 142 puts 13 14 "@1985 NINTENDO" 143 puts 9 17 "> 1 PLAYER GAME" 144 puts 9 19 " 2 PLAYER GAME" 145 puts 12 22 "TOP- 000000" 146 where 147 puts = fontPut sur fontsur 148 fontsur = getImageSurface imgres ImgFont -
lang/haskell/nario/Player.hs
r20156 r20223 57 57 58 58 imgTable = [ 59 [ImgNario 00, ImgNario01, ImgNario02, ImgNario03, ImgNario04],60 [ImgNario 10, ImgNario11, ImgNario12, ImgNario13, ImgNario14]59 [ImgNarioLStand, ImgNarioLWalk1, ImgNarioLWalk2, ImgNarioLWalk3, ImgNarioLJump], 60 [ImgNarioRStand, ImgNarioRWalk1, ImgNarioRWalk2, ImgNarioRWalk3, ImgNarioRJump] 61 61 ] 62 62 … … 76 76 vx' 77 77 | ax /= 0 = rangeadd (vx player) ax (-maxspd) maxspd 78 | (stand player)= friction (vx player) acc79 | otherwise = friction (vx player) (acc `div` 2)78 | stand player = friction (vx player) acc 79 | otherwise = vx player 80 80 x' = max xmin $ (x player) + vx' 81 81 scrx' … … 178 178 blitSurface (getImageSurface imgres imgtype) Nothing sur pos 179 179 where 180 pos = pt ((x player) `div` one - chrSize `div` 2 - scrx) ((y player) `div` one - chrSize )180 pos = pt ((x player) `div` one - chrSize `div` 2 - scrx) ((y player) `div` one - chrSize - 8) 181 181 imgtype = imgTable !! (lr player) !! (pat player) -
lang/haskell/nario/data/stage0.map
r20045 r20223 1 2 123 1223 123 1223o3 123 456 12223 4556 123 456 12223 4556123 1223 123 1223 | 1234 456 45556 456 45556123 456 12223 4556 123 456 12223 4556 ! 4565 456 45556 456 45556 !1 2 o 3 123 1223 123 1223 123 1223 123 1223 | 123 4 123 456 12223 4556 123 456 12223 4556 123 456 12223 4556 123 456 12223 4556 ! 456 5 456 45556 456 45556 456 45556 456 45556 ! 6 6 ? OOOOOOOO OOO? ? OOO O??O XX ! 7 7 XXX !
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)