Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE OverloadedStrings #-}
- import Haste.Foreign
- import Haste.Prim (toJSStr)
- data Tile = Grass | Water | Road
- data Figure = Figure {
- xpos :: Int,
- ypos :: Int,
- health :: Float
- }
- data GameBoard = GameBoard{
- sizeX :: Int,
- sizeY :: Int,
- tiles :: [Tile],
- figures :: [Figure]
- }
- render = ffi "(function(x) {renderGame(x); return 5;})"
- main = do
- let t = [Grass| x<-[1..64]]
- let f = [Figure{xpos=10, ypos=16, health=58.69}]
- let g = GameBoard{sizeX = 8, sizeY = 8, tiles= t, figures=f}
- render f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement