{"id":13467339,"url":"https://github.com/iamkun/tower_game","last_synced_at":"2025-05-15T15:05:37.205Z","repository":{"id":38272643,"uuid":"125806847","full_name":"iamkun/tower_game","owner":"iamkun","description":"💒 HTML5 Canvas Tower Building Game 🏢🏬🏦🏯🏰","archived":false,"fork":false,"pushed_at":"2024-08-09T07:33:44.000Z","size":1968,"stargazers_count":1529,"open_issues_count":5,"forks_count":427,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-31T16:13:24.832Z","etag":null,"topics":["canvas","game","html5","javascript"],"latest_commit_sha":null,"homepage":"https://iamkun.github.io/tower_game/","language":"JavaScript","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/iamkun.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-19T05:41:07.000Z","updated_at":"2025-03-28T03:30:36.000Z","dependencies_parsed_at":"2024-01-13T17:59:10.349Z","dependency_job_id":"47cbde00-06f0-4d06-93a5-f544c434c9af","html_url":"https://github.com/iamkun/tower_game","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/iamkun%2Ftower_game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamkun%2Ftower_game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamkun%2Ftower_game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamkun%2Ftower_game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamkun","download_url":"https://codeload.github.com/iamkun/tower_game/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694875,"owners_count":20980733,"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":["canvas","game","html5","javascript"],"created_at":"2024-07-31T15:00:55.215Z","updated_at":"2025-04-07T17:07:01.937Z","avatar_url":"https://github.com/iamkun.png","language":"JavaScript","readme":"[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n\u003ch1 align=\"center\"\u003eTower Building Game\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://o2qq673j2.qnssl.com/tower-loading.gif\"/\u003e\u003c/p\u003e\n\n\u003e a tower building game based on ES6 and Canvas (Tower Bloxx Deluxe Skyscraper)\n\n## Demo\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/17680888/47480922-93a20c00-d864-11e8-8f7c-6d1d60184730.gif\"/\u003e\u003c/p\u003e\n\u003ch2 align=\"center\"\u003e\u003ca href=\"https://iamkun.github.io/tower_game\"\u003eLink to online Demo (Demo Link)\u003c/a\u003e\u003c/h2\u003e\n\u003ch4 align=\"center\"\u003eMobile Devices can scan following QR code:\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/17680888/47480646-abc55b80-d863-11e8-9337-4ea768ebe55d.png\" /\u003e\n\u003c/p\u003e\n\n## Game Rule\n\nThe following are the default game rule:\n\n- In every game player starts with 3 hp. Every time a Tower block is dropped player is deduct 1 hp; game ends when hp is depleted.\n\n- Player is rewarded with 25 point for every succesful stacked blocks(Success). If a block is stacked pefectly (Perfect) on top of the previous one, then player\nrewarded with 50 points instead. Consecutive Perfects awards additional 25 points.\n\n**Note: Each Success or Perfect constitutes a floor**\n\n  For example, the first Perfect awards 50 point. The second consecutive Perfect awards 75 points.\n The third consecutive Perfect awards 100 points.  etc.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"550\" src=\"https://user-images.githubusercontent.com/17680888/47473105-d9021180-d843-11e8-8c19-b6b78d86cbdf.png\" /\u003e\n\u003c/p\u003e\n\n## Customizing the game rule\n\n```\ngit clone https://github.com/iamkun/tower_game.git\ncd tower_game\nnpm install\nnpm start\n```\nOpen `http://localhost:8082` in a web browser.\n\n- To customize image and sound resource files directly replace the corresponding file under `assets` directory.\n- To customize game rules modify the `option` object in `index.html`.\n\n## Option\n\nUse following table of `option` constants to complete customization of game rules.\n\n**Note: all constants are optionally included**\n\n| Option | Type | Description |\n|---------|--------|-------------|\n| width          | number | Width of game interface |\n| height         | number | Height of game interface |\n| canvasId       | string | DOM ID in Canvas |\n| soundOn        | boolean | If sound is on |\n| successScore   | number | Points awarded for success |\n| perfectScore   | number | Additional points awarded for perfect |\n| \u003ca href=\"#hookspeed\"\u003ehookSpeed\u003c/a\u003e | function | Speed of hook's movement |\n| \u003ca href=\"#hookangle\"\u003ehookAngle\u003c/a\u003e | function | Angle of hook |\n| \u003ca href=\"#landblockspeed\"\u003elandBlockSpeed\u003c/a\u003e | function | Speed of block sway |\n| \u003ca href=\"#setgamescore\"\u003esetGameScore\u003c/a\u003e | function | hook for current score |\n| \u003ca href=\"#setgamesuccess\"\u003esetGameSuccess\u003c/a\u003e | function | hook for number of current succesful game |\n| \u003ca href=\"#setgamefailed\"\u003esetGameFailed\u003c/a\u003e | function | hook for number of current failed game |\n\n#### hookSpeed\nSpeed of hook's movement\nThis function takes in two parameters, currentFloor and currentScore, and returns a speed value.\n```\nfunction(currentFloor, currentScore) {\n  return number\n}\n```\n\n#### hookAngle\nAngle of hook\nThis function takes in two parameters, currentFloor and currentScore, and returns a angle value.\n```\nfunction(currentFloor, currentScore) {\n  return number\n}\n```\n\n#### landBlockSpeed\nSpeed of block sway\nThis function takes in two parameters, currentFloor and currentScore, and returns a speed value.\n```\nfunction(currentFloor, currentScore) {\n  return number\n}\n```\n\n#### setGameScore\nhook for current score\nThis function takes in one parameters, score, and sets currentScore to score.\n```\nfunction(score) {\n  // your logic\n}\n```\n\n#### setGameSuccess\nhook for number of current succesful game\nThis function takes in one parameters, score, and sets GameSuccess to successCount.\n```\nfunction(successCount) {\n  // your logic\n}\n```\n\n#### setGameFailed\nhook for number of current failed game\nThis function takes in one parameters, score, and sets GameFailed to failedCount.\n```\nfunction(failedCount) {\n  // your logic\n}\n```\n\n## License\n\nMIT license.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamkun%2Ftower_game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamkun%2Ftower_game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamkun%2Ftower_game/lists"}