{"id":17178553,"url":"https://github.com/bobbylight/dragonwarriorjs","last_synced_at":"2025-06-25T23:34:25.320Z","repository":{"id":24863564,"uuid":"28279046","full_name":"bobbylight/DragonWarriorJS","owner":"bobbylight","description":"A Dragon Warrior clone written in JavaScript.","archived":false,"fork":false,"pushed_at":"2025-01-22T03:59:17.000Z","size":2185,"stargazers_count":22,"open_issues_count":11,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T08:01:49.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bobbylight.github.io/DragonWarriorJS/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobbylight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-20T21:07:06.000Z","updated_at":"2024-10-29T02:37:38.000Z","dependencies_parsed_at":"2023-01-14T01:44:29.540Z","dependency_job_id":null,"html_url":"https://github.com/bobbylight/DragonWarriorJS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FDragonWarriorJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FDragonWarriorJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FDragonWarriorJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FDragonWarriorJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobbylight","download_url":"https://codeload.github.com/bobbylight/DragonWarriorJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750108,"owners_count":21155686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-15T00:07:40.979Z","updated_at":"2025-04-13T17:11:26.346Z","avatar_url":"https://github.com/bobbylight.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DragonWarriorJS - A recreation of Dragon Warrior for the NES in TypeScript\n![Build](https://github.com/bobbylight/DragonWarriorJS/actions/workflows/build.yml/badge.svg)\n![CodeQL](https://github.com/bobbylight/DragonWarriorJS/actions/workflows/codeql-analysis.yml/badge.svg)\n\nLike it says on the tin.  This reproduction will try to be as authentic as\npossible, warts and all.\n\nWhat's (mostly) done:\n\n* Map loading, motion, moving in and out of towns\n* Collision detection\n* Conversations with NPCs\n* Sound (uses WebAudio, so Firefox and Chrome only for now)\n\nWhat's currently being worked on (half-baked):\n\n* Staying overnight at an inn\n* Buying goods from a shop\n* Battling an enemy\n\n# To test this out\n\n```bash\nnpm install\nnpm run dev\n# View http://localhost:5173\n```\n\n# Editing the Map Data\nIn theory, once the engine is done, this game is mostly data-driven.\nMost of the data is in map files.\n\n[Tiled](https://www.mapeditor.org/) is used to create the maps for this game.\nThe actual data files live in `src/tiled`.  There is one `.tmx` file per map\nin the game, including the overworld.  Please be sure to use the latest\nversion of `Tiled` when editing these files, as the XML schema of the `.tmx`\nfile format changes over time.  The game is currently being built using 1.8.4.\n\nAll maps follow the same conventions and structure. All data should be typed,\nbut typing is improving over time and isn't doc'd except in code. Layers include:\n\n* `tileLayer` - The actual map graphics.  Constitutes most of what you see.\n* `tileLayer2` (optional) - A second layer of tiles.  Used for the inside\n  of buildings with roofs in towns.  Where there are roofed buildings,\n  `tileLayer` will render the roof tile, and `tileLayer2` will render the\n  inside of the building.  This layer is omitted when it is not needed.\n* `collisionLayer` - Dictates which tiles are solid and which aren't.\n  This layer is currently used for both `tileLayer` and `tileLayer2`.\n  Solid tiles can be rendered with the `collision` tileset by entering\n  a debug key combination in the game.\n* `warpLayer` - A layer containing objects of `type` `warp`.  `warp`s are\n  used to travel from map to map, and require the following custom\n  properties:\n  * `map` - The map to warp to\n  * `row` - The row at which to place the hero\n  * `col` - The column at which to place the hero\n  * `dir` (optional) - The direction the hero should face.  Should be one\n    of `north`, `east`, `south`, or `west`\n* `npcLayer` - A layer containing objects of `type` `npc`, `talkAcross`\n  and `door`.\n  * `npc` objects should have the following custom properties:\n    * `type` - One of the values in [NpcType.ts](src/app/dw/NpcType.ts).\n    Case is ignored.  The `name` property of each `npc` is used as a lookup\n    for the NPC's conversation (see below).\n    * `wanders` - Either `true` or `false`, depending on whether you want the\n    NPC to move\n    * `dir` (optional) - The direction the hero should initially face.  Should\n    be one of `north`, `east`, `south`, or `west`.  Note you don't usually\n    need to set this unless `wanders` is `false`.\n  * `talkAcross` is an object type in `npcLayer` used to mark solid tiles the\n    hero should be able to talk over, such as tables to chat with a merchant.\n    Objects of type `talkAcross` currently have no custom properties.\n  * The `door` object type denotes a door that can be opened, e.g. with a key.\n    They have the following custom properties:\n    * `replacementTileIndex` - The tile that should replace the door tile once\n      the door has been opened.\n* `enemyTerritoryLayer` (optional) - If defined, this layer describes enemy\n  groups.  A non-empty tile type denotes an enemy group that the hero may\n  randomly fight when stepping in it.  If this layer does not exist, no\n  random battles occur in the map (e.g. in towns).\n\nThe Tiled project lives in `src/res/maps`. All data is stored in `.json` files\ninstead of `.tmx` for simplicity.\n\n# Editing NPC Conversations\nNPC's as defined in `npcLayer` above have their conversations defined in \"map\nlogic\" files that live in\n[src/app/dw/mapLogic](src/app/dw/mapLogic).\nThere is one map logic file per map.  They all follow the same pattern.  Essentially, an object maps\neach `npc`'s `name` property to a generator function that returns the\n[NpcText](src/app/dw/mapLogic/MapLogic.ts#L33)\n(i.e., the conversation that NPC will have with the hero) for that NPC. This function is passed the\n`game` instance so that it can dynamically return different values depending on how far along the\nplayer is.\n\nThe `NpcText` itself can be simple or complex, depending on how complex the NPC's conversation\nwith the hero should be. Essentially, it can be:\n\n* A string, in which case the NPC says just that. This is the simple case\n* An array of strings, in which case each string is rendered, but the user\n  has to press a key to advance the conversation between each string\n* An array containing a mixture of strings and\n  [ConversationSegmentArgs](src/app/dw/ConversationSegment.ts#L23), which allow for\n  logic in a conversation (question/answer, give/take money, etc.).  This type\n  of conversation data is not well doc'd yet and is best observed by example\n  in the source. It's essentially a grab-bag of optional fields that are each\n  used in certain conditions.\n  * Note that `ConversationSegmentArgs` can denote a \"special\" conversation type,\n    as described by the `conversationType` property.  If this property is defined, it\n    must currently be set to either `innkeeper` or `merchant`. In these cases, the\n    logic for staying at an inn or purchasing items is automatically applied.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbylight%2Fdragonwarriorjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobbylight%2Fdragonwarriorjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbylight%2Fdragonwarriorjs/lists"}