{"id":35262363,"url":"https://github.com/dat2/elm-tile-game","last_synced_at":"2026-03-27T04:30:06.408Z","repository":{"id":24525877,"uuid":"27932051","full_name":"dat2/elm-tile-game","owner":"dat2","description":"A tile game written in elm","archived":false,"fork":false,"pushed_at":"2014-12-12T19:07:28.000Z","size":272,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-17T13:44:38.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dat2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-12T18:08:28.000Z","updated_at":"2024-03-17T13:44:38.235Z","dependencies_parsed_at":"2022-07-24T01:45:05.437Z","dependency_job_id":null,"html_url":"https://github.com/dat2/elm-tile-game","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dat2/elm-tile-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat2%2Felm-tile-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat2%2Felm-tile-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat2%2Felm-tile-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat2%2Felm-tile-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dat2","download_url":"https://codeload.github.com/dat2/elm-tile-game/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat2%2Felm-tile-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31019201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-30T09:22:11.291Z","updated_at":"2026-03-27T04:30:06.380Z","avatar_url":"https://github.com/dat2.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"elm-tile-game\n=============\n\nA tile game written in elm. If there is enough interest I will extract the tile map code for others to use.\nThis game loads in [Tiled](http://www.mapeditor.org/) maps (only isometric right now) and renders them in the \ncorrect order on screen. (Snaking right to left from the back). While this does have an implementation for\nisometric tilemaps, this is mainly a toy project and is probably better to just make the game in 3D. \n\n# Assets\nThe game uses the Kenney [Isometric Landscape](http://opengameart.org/content/isometric-landscape) and [Isometric Buildings](http://opengameart.org/content/isometric-buildings-1) assets right now.\nCreate an `assets` folder in the root directory of this repository, download the zip file, and copy all files from the `PNG` folder into the assets folder you just created.\n\n\n# Tile Map notes\nThe tile map must be square, and it will render diagonally (see below for pictures). The functions described below should work for any size square (I have manually tested them vigorously) but if they do not work for some size, let me know.\n\n# Draw order versus Render order\n\nA little bit of glossary here:\n\nRender order : The directions that represent where each tile gets placed in the final picture.\n\nDraw order: The order to draw tiles so they do not overlap each other. You draw tiles from the back, different\nthan the render order.\n\nCurrently, the game expects an array of tile ids expecting to look like this:\n\u003cpre\u003e\n   -3 -2 -1  0  1  2  3\n0            0\n1         4     1\n2      8     5     2\n3  12     9     6     3\n4     13    10     7\n5        14     11\n6           15\n\nthe correct draw order: [0,1,4,2,5,8,3,6,9,12,7,10,13,11,14,15]\n\u003c/pre\u003e\n\nFor a 4x4 map, the array [0..16] will render from the top and go down and right.\n\nHowever, if you drew the tiles in that order, you'd get some tiles overlapping others and an overall weird picture. So, the `renderRightDown` function takes the tiles and converts it to the correct draw order.\n\nThe `renderCoordinates` function will give you an array of coordinates for each point from [0..16] in the following\ndraw order.\n\u003cpre\u003e\n   -3 -2 -1  0  1  2  3\n0            0\n1         2     1\n2      5     4     3\n3   9     8     7     6\n4     12    11    10\n5        14     13\n6           15\n\u003c/pre\u003e\n\n\u003cpre\u003e\n  0        1       2        3      4\n[(0, 0), (1, 1), (-1, 1), (2, 2), (2, 0), ...]\n\u003c/pre\u003e\n\nThis design may seem a bit complex, but then you can re order the array in any direction, for example left up\n\u003cpre\u003e\n   -3 -2 -1  0  1  2  3\n0            12\n1         11    13\n2      7     10    14\n3   3     6     9     15\n4      2     5     8\n5         1     4\n6            0\n\nthe correct draw order of tiles \n[12, 13, 11, 14, 10, 7, 15, 9, 6, 3, 8, 5, 2, 4, 1, 0]\n\u003c/pre\u003e\nas long as you move the tiles around in this array so that they draw in the correct order.\n\n# Building\nJust clone this repository and then run `elm-reactor` and it will automatically download everything for you.\n\n# Credit\nIf you do want to extract the tile map code on your own, please credit me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdat2%2Felm-tile-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdat2%2Felm-tile-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdat2%2Felm-tile-game/lists"}