{"id":13435116,"url":"https://github.com/potato47/jump","last_synced_at":"2026-01-17T02:02:41.816Z","repository":{"id":54563644,"uuid":"115628317","full_name":"potato47/jump","owner":"potato47","description":"微信跳一跳复刻 CocosCreator + Typescript 在线试玩 https://potato47.github.io/game/jump/","archived":false,"fork":false,"pushed_at":"2020-10-19T06:32:01.000Z","size":7791,"stargazers_count":154,"open_issues_count":2,"forks_count":56,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-27T17:25:36.878Z","etag":null,"topics":["cocos","cocos-creator","game","typescript"],"latest_commit_sha":null,"homepage":"","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/potato47.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":"2017-12-28T13:58:15.000Z","updated_at":"2024-10-22T03:23:56.000Z","dependencies_parsed_at":"2022-08-13T19:50:30.315Z","dependency_job_id":null,"html_url":"https://github.com/potato47/jump","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/potato47%2Fjump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato47%2Fjump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato47%2Fjump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato47%2Fjump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potato47","download_url":"https://codeload.github.com/potato47/jump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244143927,"owners_count":20405297,"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":["cocos","cocos-creator","game","typescript"],"created_at":"2024-07-31T03:00:32.785Z","updated_at":"2026-01-17T02:02:41.748Z","avatar_url":"https://github.com/potato47.png","language":"TypeScript","readme":"# jump\n微信跳一跳复刻 CocosCreator + Typescript 在线试玩 https://potato47.github.io/game/jump/\n\n# 简单讲两句\n\n说一下核心逻辑\n\n一开始我做的时候想用物理引擎，或者简单的用一下碰撞组件，后来发现很麻烦，不好控制落点\n\n多次观察微信跳一跳的界面发现了一个规律：\n\n人物每次跳跃落地都是固定的几个点，如果把跳跃的方块看做九宫格的正方形，那么落点一共可以分为五个，也就是上下左右中\n\n一个非常简便的方法就出来了：\n\n不需要人物落地之后再判断是否跳到方块上\n\n人物跳跃之前就根据跳跃距离（跳跃距离根据蓄力时间得出），算出人物跳跃后距离目标方块哪个点（上下左右中）最近，直接让人物执行一个固定距离的跳跃动作就可以了，完全不需要物理引擎和碰撞系统，每个落点都是预设好的\n\n当然要设定一个差值，当大于这个差值时，就代表跳到了方块外面\n\n---\n\n我还写了一个2d横版的跳一跳，感兴趣的可以看我另一个小游戏集合项目 https://github.com/potato47/so-many-games\n","funding_links":[],"categories":["游戏","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato47%2Fjump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotato47%2Fjump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato47%2Fjump/lists"}