{"id":1193,"date":"2025-04-23T06:00:09","date_gmt":"2025-04-22T22:00:09","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/"},"modified":"2025-04-23T06:00:09","modified_gmt":"2025-04-22T22:00:09","slug":"gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/","title":{"rendered":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09"},"content":{"rendered":"<div class=\"article_content clearfix\" id=\"article_content\">\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/kdoc_html_views-1a98987dfd.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/ck_htmledit_views-704d5b9767.css\" rel=\"stylesheet\"\/>\n<div class=\"markdown_views prism-tomorrow-night\" id=\"content_views\">\n  <svg style=\"display: none;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n   <path d=\"M5,0 0,2.5 5,5z\" id=\"raphael-marker-block\" stroke-linecap=\"round\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\n   <\/path>\n  <\/svg><\/p>\n<blockquote>\n<p>\n    \u539f\u6587\uff1a<br \/>\n    <a href=\"https:\/\/zh.annas-archive.org\/md5\/B91F6649162E9805B55AF1CE820DC361\" rel=\"nofollow\"><br \/>\n     <code><br \/>\n      zh.annas-archive.org\/md5\/B91F6649162E9805B55AF1CE820DC361<br \/>\n     <\/code><br \/>\n    <\/a>\n   <\/p>\n<p>\n    \u8bd1\u8005\uff1a<br \/>\n    <a href=\"https:\/\/github.com\/wizardforcel\"><br \/>\n     \u98de\u9f99<br \/>\n    <\/a>\n   <\/p>\n<p>\n    \u534f\u8bae\uff1a<br \/>\n    <a href=\"http:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/\" rel=\"nofollow\"><br \/>\n     CC BY-NC-SA 4.0<br \/>\n    <\/a>\n   <\/p>\n<\/blockquote>\n<h2>\n   <a id=\"_8\"><br \/>\n   <\/a><br \/>\n   \u7b2c\u56db\u7ae0\uff1a\u5192\u9669\u5f00\u59cb<br \/>\n  <\/h2>\n<p>\n   \u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u6709\u8da3\u7684\u5c0f\u52a8\u4f5c\u5192\u9669\u6e38\u620f\uff0c\u8fd9\u5c06\u5efa\u7acb\u5728\u6211\u4eec\u7684\u57fa\u7840\u77e5\u8bc6\u4e4b\u4e0a\u3002\u6211\u4eec\u5c06\u4ece\u4e00\u4e2a\u53ef\u4ee5\u5728\u4e16\u754c\u4e2d\u5bfc\u822a\u5e76\u5177\u6709\u77ed\u7a0b\u8fd1\u6218\u653b\u51fb\u7684\u52a8\u753b\u73a9\u5bb6\u89d2\u8272\u5f00\u59cb\u3002\u6e38\u620f\u4e16\u754c\u5c06\u7531\u591a\u4e2a\u623f\u95f4\u7ec4\u6210\uff0c\u73a9\u5bb6\u5c06\u80fd\u591f\u4ece\u4e00\u4e2a\u623f\u95f4\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u623f\u95f4\uff0c\u540c\u65f6\u4fdd\u7559\u6240\u6709\u4ed6\u4eec\u7684\u7edf\u8ba1\u6570\u636e\u3002\u6211\u4eec\u5c06\u628a\u6240\u6709\u73a9\u5bb6\u63a7\u5236\u7684\u4ee3\u7801\u548c\u5904\u7406\u5899\u58c1\u78b0\u649e\u7684\u4ee3\u7801\u653e\u5728\u4e00\u4e2a\u811a\u672c\u4e2d\uff0c\u4ee5\u521b\u5efa\u4e00\u4e2a\u66f4\u9ad8\u6548\u7684\u9879\u76ee\u3002\n  <\/p>\n<p>\n   \u5982\u4e0b\u622a\u56fe\u6240\u793a\uff0c\u8fd9\u4e2a\u6e38\u620f\u7684\u4e3b\u9898\u662f\u9ad8\u4e2d\u7684\u6050\u6016\uff0c\u4e16\u754c\u91cc\u4f1a\u6709\u4e09\u4e2a\u57fa\u672c\u4eba\u5de5\u667a\u80fd\u7684\u654c\u4eba\uff1a\u4e00\u4e2a\u5e7d\u7075\u56fe\u4e66\u7ba1\u7406\u5458\uff0c\u4e00\u4e2a\u4e71\u6597\uff0c\u548c\u4e00\u4e2a\u6559\u7ec3\u3002\u5e7d\u7075\u56fe\u4e66\u7ba1\u7406\u5458\u4f1a\u5728\u73a9\u5bb6\u63a5\u8fd1\u5b83\u7684\u4f11\u606f\u5730\u70b9\u65f6\u51fa\u73b0\uff0c\u5e76\u8ffd\u9010\u73a9\u5bb6\u76f4\u5230\u8ddd\u79bb\u592a\u8fdc\uff0c\u7136\u540e\u8fd4\u56de\u539f\u6765\u7684\u4f4d\u7f6e\u3002\u4e71\u6597\u4f1a\u5728\u623f\u95f4\u91cc\u6f2b\u6e38\uff0c\u5982\u679c\u5b83\u53d1\u73b0\u73a9\u5bb6\uff0c\u5b83\u4f1a\u589e\u52a0\u4f53\u79ef\u548c\u901f\u5ea6\u3002\u6559\u7ec3\u662f\u5956\u676f\u7684\u5b88\u62a4\u8005\uff0c\u4f1a\u72ec\u81ea\u5728\u4e16\u754c\u4e2d\u5bfc\u822a\u3002\u5982\u679c\u5b83\u770b\u5230\u73a9\u5bb6\uff0c\u5b83\u4f1a\u8ffd\u51fb\u5e76\u907f\u5f00\u5899\u58c1\u548c\u5176\u4ed6\u6559\u7ec3\uff0c\u5982\u679c\u8db3\u591f\u63a5\u8fd1\uff0c\u5b83\u4f1a\u5bf9\u73a9\u5bb6\u8fdb\u884c\u8fd1\u6218\u653b\u51fb\u3002\n  <\/p>\n<\/p>\n<h2>\n   <a id=\"_16\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u52a8\u753b\u89d2\u8272<br \/>\n  <\/h2>\n<p>\n   \u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u521b\u5efa\u7684\u73a9\u5bb6\u5bf9\u8c61\u975e\u5e38\u57fa\u672c\u3002\u5728\u7b2c\u4e00\u7ae0\u4e2d\uff0c<br \/>\n   <em><br \/>\n    \u4e0e\u60a8\u7684\u7b2c\u4e00\u4e2a\u6e38\u620f\u4e00\u8d77\u4e86\u89e3 Studio<br \/>\n   <\/em><br \/>\n   \uff0c\u73a9\u5bb6\u6ca1\u6709\u52a8\u753b\u3002\u5728\u7b2c\u4e09\u7ae0\u4e2d\uff0c<br \/>\n   <em><br \/>\n    \u5c04\u51fb\u6e38\u620f\uff1a\u521b\u5efa\u4e00\u4e2a\u6a2a\u5411\u5377\u8f74\u5c04\u51fb\u6e38\u620f<br \/>\n   <\/em><br \/>\n   \uff0c\u98de\u8239\u6709\u52a8\u753b\uff0c\u4f46\u59cb\u7ec8\u9762\u5411\u53f3\u4fa7\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u62e5\u6709\u4e00\u4e2a\u53ef\u4ee5\u671d\u56db\u4e2a\u65b9\u5411\u79fb\u52a8\u5e76\u5177\u6709\u6bcf\u4e2a\u65b9\u5411\u7684\u52a8\u753b\u7cbe\u7075\u7684\u89d2\u8272\u3002\u6211\u4eec\u8fd8\u5c06\u5b9e\u73b0\u4e00\u4e2a\u8fd1\u6218\u653b\u51fb\uff0c\u53ef\u4ee5\u5728\u89d2\u8272\u9762\u5bf9\u7684\u65b9\u5411\u4e0a\u4f7f\u7528\u3002\n  <\/p>\n<h3>\n   <a id=\"_20\"><br \/>\n   <\/a><br \/>\n   \u7b80\u5316\u89d2\u8272\u79fb\u52a8<br \/>\n  <\/h3>\n<p>\n   \u73a9\u5bb6\u89d2\u8272\u7684\u884c\u8d70\u5faa\u73af\u9700\u8981\u56db\u4e2a\u5355\u72ec\u7684\u7cbe\u7075\u3002\u6211\u4eec\u5c06\u5148\u4ecb\u7ecd\u7b2c\u4e00\u4e2a\uff0c\u7136\u540e\u60a8\u53ef\u4ee5\u521b\u5efa\u5176\u4ed6\u4e09\u4e2a\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u4ece\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n     <code><br \/>\n      Chapter_04<br \/>\n     <\/code><br \/>\n     \u7684\u65b0\u9879\u76ee\u5f00\u59cb\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u7cbe\u7075\uff0c\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      spr_Player_WalkRight<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u52a0\u8f7d<br \/>\n     <code><br \/>\n      \u7b2c\u56db\u7ae0\/\u7cbe\u7075\/Player_WalkRight.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      \u4e2d\u5fc3<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5355\u51fb<br \/>\n     <strong><br \/>\n      \u4fee\u6539\u63a9\u7801<br \/>\n     <\/strong><br \/>\n     \u4ee5\u6253\u5f00<br \/>\n     <strong><br \/>\n      \u63a9\u7801\u5c5e\u6027<br \/>\n     <\/strong><br \/>\n     \u7f16\u8f91\u5668\uff0c\u5e76\u5728<br \/>\n     <strong><br \/>\n      \u8fb9\u754c\u6846<br \/>\n     <\/strong><br \/>\n     \u4e0b\u9009\u62e9<br \/>\n     <strong><br \/>\n      \u5b8c\u6574\u56fe\u50cf<br \/>\n     <\/strong><br \/>\n     \u7684\u5355\u9009\u6309\u94ae\u3002\u8fd9\u5c06\u8bbe\u7f6e\u78b0\u649e\u6846\u4e3a\u6574\u4e2a\u7cbe\u7075\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\u91cd\u590d\u6b64\u8fc7\u7a0b\u4ee5\u52a0\u8f7d<br \/>\n     <code><br \/>\n      spr_Player_WalkLeft<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <code><br \/>\n      spr_Player_WalkUp<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Player_WalkDown<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Player_WalkRight<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a\u7cbe\u7075\u3002\u5b9e\u9645\u4e0a\uff0c\u5728\u8fd9\u91cc\u8bbe\u7f6e\u73a9\u5bb6\u7cbe\u7075\u7684\u54ea\u4e00\u4e2a\u5e76\u4e0d\u91cd\u8981\uff0c\u56e0\u4e3a\u6211\u4eec\u5c06\u4f7f\u7528\u4ee3\u7801\u6765\u6539\u53d8\u663e\u793a\u7684\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u4e00\u4e9b\u521d\u59cb\u53d8\u91cf\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">;<\/span>\nmyDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nisAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nhealth <span class=\"token operator\">=<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u524d\u4e24\u4e2a\u53d8\u91cf\u662f\u73a9\u5bb6\u901f\u5ea6\u548c\u65b9\u5411\u7684\u5360\u4f4d\u7b26\u3002\u8fd9\u5c06\u5f88\u6709\u7528\uff0c\u56e0\u4e3a\u6211\u4eec\u53ef\u4ee5\u5f71\u54cd\u8fd9\u4e9b\u503c\uff0c\u800c\u4e0d\u5f71\u54cd\u5bf9\u8c61\u7684\u672c\u5730<br \/>\n   <code><br \/>\n    mySpeed<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    myDirection<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\uff0c\u6bd4\u5982\u5728\u5bf9\u8c61\u9762\u5bf9\u4e00\u4e2a\u65b9\u5411\u79fb\u52a8\u65f6\u4ea7\u751f\u7684\u51fb\u9000\u6548\u679c\u3002\u53d8\u91cf<br \/>\n   <code><br \/>\n    isAttacking<br \/>\n   <\/code><br \/>\n   \u5c06\u7528\u4e8e\u6307\u793a\u6211\u4eec\u4f55\u65f6\u53d1\u8d77\u6218\u6597\uff0c<br \/>\n   <code><br \/>\n    isWalking<br \/>\n   <\/code><br \/>\n   \u5c06\u6307\u793a\u73a9\u5bb6\u4f55\u65f6\u79fb\u52a8\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u6709\u5168\u5c40\u53d8\u91cf<br \/>\n   <code><br \/>\n    health<br \/>\n   <\/code><br \/>\n   \uff0c\u8bbe\u7f6e\u4e3a 100%\u3002\u6700\u540e\uff0c\u6211\u4eec\u5c06\u52a8\u753b\u901f\u5ea6\u8bbe\u7f6e\u4e3a 50%\uff0c\u4ee5\u4fbf\u884c\u8d70\u5faa\u73af\u64ad\u653e\u6b63\u786e\u3002\n  <\/p>\n<h4>\n   <a id=\"_51\"><br \/>\n   <\/a><br \/>\n   \u6ce8\u610f<br \/>\n  <\/h4>\n<p>\n   \u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e GameMaker: Studio \u5185\u7f6e\u53d8\u91cf\u548c\u51fd\u6570\u7684\u4fe1\u606f\uff0c\u8bf7\u70b9\u51fb<br \/>\n   <strong><br \/>\n    \u5e2e\u52a9<br \/>\n   <\/strong><br \/>\n   |<br \/>\n   <strong><br \/>\n    \u76ee\u5f55<br \/>\n   <\/strong><br \/>\n   \u67e5\u770b GameMaker \u7528\u6237\u624b\u518c\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u73a9\u5bb6\u7684\u79fb\u52a8\u4e86\u3002\u6211\u4eec\u4e0d\u518d\u4e3a\u6bcf\u4e2a\u952e\u521b\u5efa\u591a\u4e2a\u811a\u672c\uff0c\u800c\u662f\u5c06\u6240\u6709\u63a7\u4ef6\u653e\u5165\u4e00\u4e2a\u5355\u72ec\u7684\u811a\u672c\u4e2d\uff0c\u7b80\u5316\u4ee3\u7801\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Player_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u4ece\u4ee5\u4e0b\u4ee3\u7801\u5f00\u59cb\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_right<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">+<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    x <span class=\"token operator\">+=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    myDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    sprite_index <span class=\"token operator\">=<\/span> spr_Player_WalkRight<span class=\"token punctuation\">;<\/span>\n    isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u5c06<br \/>\n   <code><br \/>\n    isWalking<br \/>\n   <\/code><br \/>\n   \u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    false<br \/>\n   <\/code><br \/>\n   \uff0c\u4f7f\u5176\u6210\u4e3a\u73a9\u5bb6\u6b63\u5728\u8fdb\u884c\u7684\u9ed8\u8ba4\u72b6\u6001\u3002\u4e4b\u540e\uff0c\u6211\u4eec\u68c0\u67e5\u952e\u76d8\u662f\u5426\u6309\u4e0b\u53f3\u7bad\u5934\u952e\uff08<br \/>\n   <code><br \/>\n    vk_right<br \/>\n   <\/code><br \/>\n   \uff09\uff0c\u5e76\u68c0\u67e5\u5f53\u524d\u4f4d\u7f6e\u53f3\u4fa7\u662f\u5426\u6709\u5b9e\u4f53\u7269\u4f53\u3002<br \/>\n   <code><br \/>\n    place_free<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u5c06\u8fd4\u56de\u6307\u5b9a\u70b9\u662f\u5426\u65e0\u78b0\u649e\u3002\u5982\u679c\u73a9\u5bb6\u80fd\u591f\u79fb\u52a8\u5e76\u4e14\u6309\u4e0b\u4e86\u952e\uff0c\u6211\u4eec\u5c31\u5411\u53f3\u79fb\u52a8\uff0c\u5e76\u5c06\u65b9\u5411\u8bbe\u7f6e\u4e3a\u96f6\u4ee5\u8868\u793a\u5411\u53f3\u3002\u6211\u4eec\u5c06\u7cbe\u7075\u66f4\u6539\u4e3a\u9762\u5411\u53f3\u4fa7\u7684\u884c\u8d70\u5faa\u73af\uff0c\u7136\u540e\u5c06<br \/>\n   <code><br \/>\n    isWalking<br \/>\n   <\/code><br \/>\n   \u66f4\u6539\u4e3a<br \/>\n   <code><br \/>\n    true<br \/>\n   <\/code><br \/>\n   \uff0c\u8fd9\u5c06\u8986\u76d6\u6211\u4eec\u5c06\u5176\u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    false<br \/>\n   <\/code><br \/>\n   \u7684\u7b2c\u4e00\u884c\u4ee3\u7801\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u91cd\u590d\u8fd9\u6bb5\u4ee3\u7801\uff0c\u9488\u5bf9\u5269\u4e0b\u7684\u4e09\u4e2a\u65b9\u5411\u8fdb\u884c\u8c03\u6574\u3002\u6bcf\u4e2a\u65b9\u5411\u90fd\u5e94\u8be5\u67e5\u770b\u54ea\u4e2a\u952e\u88ab\u6309\u4e0b\uff0c\u5e76\u67e5\u770b\u4ece\u8be5\u4f4d\u7f6e\u662f\u5426\u6709\u4efb\u4f55\u78b0\u649e\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u79fb\u52a8\u63a7\u4ef6\u5b8c\u6210\u4e4b\u524d\uff0c\u6211\u4eec\u8fd8\u6709\u4e00\u4ef6\u4e8b\u8981\u505a\u3002\u5982\u679c\u73a9\u5bb6\u6ca1\u6709\u79fb\u52a8\uff0c\u6211\u4eec\u5e0c\u671b\u52a8\u753b\u505c\u6b62\uff0c\u5e76\u5728\u5f00\u59cb\u79fb\u52a8\u65f6\u91cd\u65b0\u5f00\u59cb\u64ad\u653e\u3002\u5728\u811a\u672c\u7684\u672b\u5c3e\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isWalking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u521b\u5efa\u4e86\u53d8\u91cf<br \/>\n   <code><br \/>\n    isWalking<br \/>\n   <\/code><br \/>\n   \u6765\u5728\u884c\u8d70\u548c\u505c\u6b62\u72b6\u6001\u4e4b\u95f4\u5207\u6362\u3002\u5982\u679c\u73a9\u5bb6\u5728\u79fb\u52a8\uff0c\u7cbe\u7075\u5c06\u64ad\u653e\u52a8\u753b\u3002\u5982\u679c\u73a9\u5bb6\u6ca1\u6709\u79fb\u52a8\uff0c\u6211\u4eec\u4e5f\u505c\u6b62\u52a8\u753b\u3002\n  <\/p>\n<p>\n   \u5f53\u4ee3\u7801\u5b8c\u6210\u65f6\uff0c\u5e94\u8be5\u5982\u4e0b\u6240\u793a\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\">isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_right<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">+<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    x <span class=\"token operator\">+=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    myDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    sprite_index <span class=\"token operator\">=<\/span> spr_Player_WalkRight<span class=\"token punctuation\">;<\/span>\n    isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_up<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y <span class=\"token operator\">-<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    y <span class=\"token operator\">-=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    myDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span>\n    sprite_index <span class=\"token operator\">=<\/span> spr_Player_WalkUp<span class=\"token punctuation\">;<\/span>\n    isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_left<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">-<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    x <span class=\"token operator\">-=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    myDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span>\n    sprite_index <span class=\"token operator\">=<\/span> spr_Player_WalkLeft<span class=\"token punctuation\">;<\/span>\n    isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_down<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y <span class=\"token operator\">+<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    y <span class=\"token operator\">+=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    myDirection <span class=\"token operator\">=<\/span> <span class=\"token number\">270<\/span><span class=\"token punctuation\">;<\/span>\n    sprite_index <span class=\"token operator\">=<\/span> spr_Player_WalkDown<span class=\"token punctuation\">;<\/span>\n    isWalking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isWalking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> \n<\/code><\/pre>\n<ol>\n<li>\n    \u5c06\u8fd9\u4e9b\u811a\u672c\u5e94\u7528\u5230\u9002\u5f53\u7684\u4e8b\u4ef6\u4e2d\uff0c<br \/>\n    <code><br \/>\n     scr_Player_Create<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     \u521b\u5efa<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u4ee5\u53ca<br \/>\n    <code><br \/>\n     scr_Player_Step<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     \u6b65\u8fdb<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u3002\n   <\/li>\n<\/ol>\n<p>\n   \u73a9\u5bb6\u5df2\u7ecf\u51c6\u5907\u597d\u79fb\u52a8\u548c\u6b63\u786e\u64ad\u653e\u52a8\u753b\u4e86\uff0c\u4f46\u5982\u679c\u6ca1\u6709\u6dfb\u52a0\u4e00\u4e9b\u5b9e\u4f53\u969c\u788d\u7269\uff0c\u6211\u4eec\u5c06\u65e0\u6cd5\u5b8c\u5168\u6d4b\u8bd5\u4ee3\u7801\u3002\u8ba9\u6211\u4eec\u5efa\u4e00\u5835\u5899\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Wall<br \/>\n     <\/code><br \/>\n     \uff0c\u52a0\u8f7d<br \/>\n     <code><br \/>\n      \u7b2c\u56db\u7ae0\/\u7cbe\u7075\/\u5899.png<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u53d6\u6d88\u9009\u4e2d<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u6211\u4eec\u4f7f\u7528 PNG \u6587\u4ef6\uff0c\u56e0\u4e3a\u8fd9\u5835\u5899\u7565\u5fae\u900f\u660e\uff0c\u8fd9\u5728\u4ee5\u540e\u88c5\u9970\u623f\u95f4\u65f6\u4f1a\u5f88\u6709\u7528\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Wall<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06\u7cbe\u7075\u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      spr_Wall<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5b9e\u4f53<br \/>\n     <\/strong><br \/>\n     \u6846\u3002\u73b0\u5728\u8fd9\u5835\u5899\u88ab\u6807\u8bc6\u4e3a\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u623f\u95f4\uff0c\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      \u6c99\u76d2<br \/>\n     <\/code><br \/>\n     \u3002\u6211\u4eec\u5c06\u4f7f\u7528\u8fd9\u4e2a\u623f\u95f4\u6765\u6d4b\u8bd5\u529f\u80fd\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u623f\u95f4\u7684\u4e2d\u5fc3\u67d0\u5904\u653e\u7f6e\u4e00\u4e2a<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u623f\u95f4\u7684\u5468\u8fb9\u653e\u7f6e<br \/>\n     <code><br \/>\n      obj_Wall<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\uff0c\u5e76\u6dfb\u52a0\u4e00\u4e9b\u989d\u5916\u7684\u90e8\u5206\uff0c\u5982\u4e0b\u5c4f\u5e55\u622a\u56fe\u6240\u793a\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u6b64\u65f6\u73a9\u5bb6\u5e94\u8be5\u80fd\u591f\u5728\u5f00\u653e\u533a\u57df\u81ea\u7531\u79fb\u52a8\uff0c\u5e76\u5728\u4e0e\u5899\u78b0\u649e\u65f6\u505c\u6b62\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<h3>\n   <a id=\"_143\"><br \/>\n   <\/a><br \/>\n   \u5b9e\u65bd\u8fd1\u6218\u653b\u51fb<br \/>\n  <\/h3>\n<p>\n   \u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u8ba9\u73a9\u5bb6\u79fb\u52a8\u6b63\u5e38\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u8fdb\u884c\u653b\u51fb\u4e86\u3002\u6211\u4eec\u6b63\u5728\u521b\u5efa\u7684\u653b\u51fb\u53ea\u9700\u8981\u5f71\u54cd\u73a9\u5bb6\u89d2\u8272\u524d\u9762\u7684\u7269\u4f53\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u8fd1\u6218\u653b\u51fb\u5bf9\u8c61\uff0c\u5b83\u5c06\u5728\u547d\u4ee4\u4e0b\u751f\u6210\u5e76\u5728\u6e38\u620f\u4e2d\u81ea\u884c\u79fb\u9664\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Player_Attack<br \/>\n     <\/code><br \/>\n     \uff0c\u52a0\u8f7d<br \/>\n     <code><br \/>\n      \u7b2c\u56db\u7ae0\/\u7cbe\u7075\/Player_Attack.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u9009\u4e2d<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u8fd9\u662f\u4e00\u4e2a\u52a8\u753b\u7cbe\u7075\uff0c\u4ee3\u8868\u6325\u52a8\u7684\u8fd1\u6218\u653b\u51fb\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u78b0\u649e\u533a\u57df\u5f71\u54cd\u7cbe\u7075\u7684\u6574\u4e2a\u9ad8\u5ea6\uff0c\u4f46\u4e0d\u5f71\u54cd\u6574\u4e2a\u5bbd\u5ea6\u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u4fee\u6539\u63a9\u7801<br \/>\n     <\/strong><br \/>\n     \uff0c\u5728<br \/>\n     <strong><br \/>\n      \u63a9\u7801\u5c5e\u6027<br \/>\n     <\/strong><br \/>\n     \u7f16\u8f91\u5668\u4e2d\uff0c\u9009\u62e9<br \/>\n     <strong><br \/>\n      \u8fb9\u754c\u6846<br \/>\n     <\/strong><br \/>\n     \u4e0b\u7684<br \/>\n     <strong><br \/>\n      \u624b\u52a8<br \/>\n     <\/strong><br \/>\n     \u5355\u9009\u6309\u94ae\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8c03\u6574<br \/>\n     <strong><br \/>\n      \u8fb9\u754c\u6846<br \/>\n     <\/strong><br \/>\n     \u7684\u503c\u4e3a<br \/>\n     <strong><br \/>\n      \u5de6<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u53f3<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      24<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u9876\u90e8<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      \u5e95\u90e8<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      4<br \/>\n     <\/code><br \/>\n     \u3002\u6700\u7ec8\u7ed3\u679c\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4ee5\u4e0b\u7684\u5c4f\u5e55\u622a\u56fe\u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u8fd9\u4e2a\u5bf9\u8c61\u59cb\u7ec8\u51fa\u73b0\u5728\u73a9\u5bb6\u7684\u524d\u9762\u3002\u786e\u4fdd\u8fd9\u4e00\u70b9\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u4e4b\u4e00\u662f\u8ba9\u8fd9\u4e2a\u5bf9\u8c61\u968f\u7740\u73a9\u5bb6\u4e00\u8d77\u65cb\u8f6c\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      -16<br \/>\n     <\/code><br \/>\n     <strong><br \/>\n      Y:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      24<br \/>\n     <\/code><br \/>\n     \u3002\u5c06 X \u5750\u6807\u8bbe\u7f6e\u4e3a\u5de6\u4fa7\u610f\u5473\u7740\u8fd9\u4e2a\u5bf9\u8c61\u5728\u751f\u6210\u65f6\u5c06\u6709 16 \u50cf\u7d20\u7684\u504f\u79fb\u3002\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u65cb\u8f6c\u653b\u51fb\u4ee5\u5339\u914d\u73a9\u5bb6\u7684\u65b9\u5411\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Player_Attack<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Player Attack<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a\u5176\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -100<br \/>\n     <\/code><br \/>\n     \u3002<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u51b3\u5b9a\u4e86\u4e00\u4e2a\u5bf9\u8c61\u5b9e\u4f8b\u5728\u5c4f\u5e55\u4e0a\u662f\u5728\u53e6\u4e00\u4e2a\u5bf9\u8c61\u7684\u540e\u9762\u8fd8\u662f\u4e0a\u9762\u3002\u5c06\u5176\u8bbe\u7f6e\u4e3a\u8d1f\u503c\u610f\u5473\u7740\u5b83\u5c06\u5728\u5177\u6709\u66f4\u9ad8\u6df1\u5ea6\u503c\u7684\u4efb\u4f55\u5bf9\u8c61\u4e0a\u7ed8\u5236\u3002\u5c06\u503c\u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -100<br \/>\n     <\/code><br \/>\n     \u5141\u8bb8\u6211\u4eec\u5728\u9ed8\u8ba4\u7684<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      -99<br \/>\n     <\/code><br \/>\n     \u4e4b\u95f4\u62e5\u6709\u5176\u4ed6\u6df1\u5ea6\u7684\u5bf9\u8c61\uff0c\u800c\u65e0\u9700\u62c5\u5fc3\u4ee5\u540e\u9700\u8981\u91cd\u65b0\u8c03\u6574\u4e8b\u7269\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Attack_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">image_angle <span class=\"token operator\">=<\/span> obj_Player<span class=\"token punctuation\">.<\/span>myDirection<span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.3<\/span><span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">;<\/span>\nobj_Player<span class=\"token punctuation\">.<\/span>isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u5c31\u662f\u6211\u4eec\u5c06\u56fe\u50cf\u65cb\u8f6c\u5230\u4e0e\u73a9\u5bb6\u9762\u5411\u76f8\u540c\u65b9\u5411\u7684\u5730\u65b9\uff0c\u7ed3\u5408\u6211\u4eec\u8bbe\u7f6e\u7684\u504f\u79fb\u539f\u70b9\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u5c06\u51fa\u73b0\u5728\u73a9\u5bb6\u7684\u524d\u9762\u3002\u6211\u4eec\u8fd8\u4f1a\u51cf\u6162\u52a8\u753b\u901f\u5ea6\uff0c\u5e76\u8bbe\u7f6e\u4e00\u4e2a\u516d\u5e27\u7684\u8b66\u62a5\u3002\u8fd9\u4e2a\u8b66\u62a5\u5c06\u5728\u89e6\u53d1\u65f6\u79fb\u9664\u653b\u51fb\u5bf9\u8c61\u3002\u6700\u540e\uff0c\u6211\u4eec\u544a\u8bc9\u73a9\u5bb6\u6b63\u5728\u8fdb\u884c\u653b\u51fb\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      obj_Player_Attack<br \/>\n     <\/code><br \/>\n     \u4e2d\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u9644\u4e0a\u8fd9\u4e2a\u811a\u672c\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u7ee7\u7eed\u8fdb\u884c\u8b66\u62a5\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Attack_Alarm<br \/>\n     <\/code><br \/>\n     \u3002\u5b83\u4e0d\u4ec5\u9700\u8981\u79fb\u9664\u653b\u51fb\uff0c\u8fd8\u9700\u8981\u8ba9\u73a9\u5bb6\u77e5\u9053\u5b83\u5df2\u7ecf\u6d88\u5931\uff0c\u4ed6\u4eec\u53ef\u4ee5\u518d\u6b21\u8fdb\u884c\u653b\u51fb\u3002\u6211\u4eec\u53ea\u9700\u8981\u4e24\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u505a\u5230\u8fd9\u4e00\u5207\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">obj_Player<span class=\"token punctuation\">.<\/span>isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4e0e\u73a9\u5bb6\u7684<br \/>\n   <code><br \/>\n    isAttacking<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u4ea4\u8c08\uff0c\u5e76\u5c06\u5176\u8bbe\u7f6e\u56de<br \/>\n   <code><br \/>\n    false<br \/>\n   <\/code><br \/>\n   \u3002\u7136\u540e\u6211\u4eec\u9500\u6bc1\u8fd1\u6218\u653b\u51fb\u7684\u5b9e\u4f8b\u3002\u5c06\u8fd9\u4e2a\u811a\u672c\u9644\u52a0\u5230<br \/>\n   <strong><br \/>\n    Alarm 0<br \/>\n   <\/strong><br \/>\n   \u4e8b\u4ef6\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ea\u9700\u8981\u8ba9\u73a9\u5bb6\u751f\u6210\u4e00\u4e2a\u653b\u51fb\u7684\u5b9e\u4f8b\u3002\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Player_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5728\u5e95\u90e8\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check_pressed<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">ord<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Z'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> isAttacking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player_Attack<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   <code><br \/>\n    keyboard_check_pressed<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u53ea\u5728\u6309\u4e0b\u952e\u65f6\u6fc0\u6d3b\uff0c\u800c\u4e0d\u662f\u5728\u6309\u4e0b\u4f4d\u7f6e\uff0c\u800c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u6b63\u5728\u68c0\u67e5<br \/>\n   <em><br \/>\n    Z<br \/>\n   <\/em><br \/>\n   \u952e\u3002\u952e\u76d8\u4e0a\u7684\u5404\u79cd\u5b57\u6bcd\u6ca1\u6709\u7279\u6b8a\u547d\u4ee4\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u4f7f\u7528<br \/>\n   <code><br \/>\n    ord<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\uff0c\u5b83\u8fd4\u56de\u4f20\u9012\u7ed9\u5b83\u7684\u5b57\u7b26\u7684\u76f8\u5e94 ASCII \u4ee3\u7801\u3002\u6211\u4eec\u8fd8\u68c0\u67e5\u73a9\u5bb6\u5f53\u524d\u662f\u5426\u6ca1\u6709\u8fdb\u884c\u653b\u51fb\u3002\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c\u6211\u4eec\u751f\u6210\u653b\u51fb\uff0c\u653b\u51fb\u5c06\u6539\u53d8<br \/>\n   <code><br \/>\n    isAttacking<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u4e3a true\uff0c\u8fd9\u6837\u5c31\u53ea\u4f1a\u53d1\u751f\u4e00\u6b21\u3002\n  <\/p>\n<h4>\n   <a id=\"_192\"><br \/>\n   <\/a><br \/>\n   \u6ce8\u610f<br \/>\n  <\/h4>\n<p>\n   \u5728\u4f7f\u7528<br \/>\n   <code><br \/>\n    ord<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u65f6\uff0c\u59cb\u7ec8\u4f7f\u7528\u5927\u5199\u5b57\u6bcd\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5f97\u5230\u9519\u8bef\u7684\u6570\u5b57\uff01\n  <\/p>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u4f60\u5e94\u8be5\u80fd\u591f\u6309\u4e0b<br \/>\n    <em><br \/>\n     Z<br \/>\n    <\/em><br \/>\n    \u952e\uff0c\u65e0\u8bba\u89d2\u8272\u9762\u5411\u54ea\u4e2a\u65b9\u5411\uff0c\u90fd\u80fd\u770b\u5230\u73a9\u5bb6\u9762\u524d\u72ec\u7279\u7684\u6325\u52a8\u52a8\u4f5c\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\u3002\u73a9\u5bb6\u73b0\u5728\u5df2\u7ecf\u51c6\u5907\u597d\u6218\u6597\u4e86\uff01\u5b9e\u65bd\u8fd1\u6218\u653b\u51fb\n   <\/li>\n<\/ol>\n<h2>\n   <a id=\"_198\"><br \/>\n   <\/a><br \/>\n   \u5728\u623f\u95f4\u4e4b\u95f4\u5bfc\u822a<br \/>\n  <\/h2>\n<p>\n   \u5982\u679c\u4e00\u5207\u90fd\u53d1\u751f\u5728\u4e00\u4e2a\u975e\u5e38\u5927\u7684\u623f\u95f4\u91cc\uff0c\u5192\u9669\u6e38\u620f\u4f1a\u53d8\u5f97\u76f8\u5f53\u65e0\u804a\u3002\u8fd9\u4e0d\u4ec5\u6548\u7387\u4f4e\u4e0b\uff0c\u800c\u4e14\u4e16\u754c\u4e5f\u4f1a\u7f3a\u4e4f\u63a2\u7d22\u7684\u611f\u89c9\u3002\u4ece\u4e00\u4e2a\u623f\u95f4\u5207\u6362\u5230\u53e6\u4e00\u4e2a\u623f\u95f4\u5f88\u5bb9\u6613\uff0c\u4f46\u786e\u5b9e\u4f1a\u5e26\u6765\u95ee\u9898\u3002\n  <\/p>\n<p>\n   \u7b2c\u4e00\u4e2a\u95ee\u9898\u662f\u4fdd\u7559\u73a9\u5bb6\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u6bd4\u5982\u5065\u5eb7\uff0c\u4ece\u4e00\u4e2a\u623f\u95f4\u5230\u53e6\u4e00\u4e2a\u623f\u95f4\u3002\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u4e00\u4e2a\u65b9\u6cd5\u662f\u5728\u73a9\u5bb6\u8eab\u4e0a\u6fc0\u6d3b<br \/>\n   <strong><br \/>\n    \u6301\u4e45\u6027<br \/>\n   <\/strong><br \/>\n   \u3002\u6301\u4e45\u6027\u610f\u5473\u7740\u6211\u4eec\u53ea\u9700\u8981\u5728\u4e00\u4e2a\u623f\u95f4\u653e\u7f6e\u4e00\u4e2a\u5bf9\u8c61\u7684\u5355\u4e2a\u5b9e\u4f8b\uff0c\u4ece\u90a3\u65f6\u8d77\u5b83\u5c06\u4e00\u76f4\u5b58\u5728\u4e8e\u6e38\u620f\u4e16\u754c\u4e2d\u3002\n  <\/p>\n<p>\n   \u7b2c\u4e8c\u4e2a\u95ee\u9898\u662f\u5728\u4e00\u4e2a\u6709\u591a\u4e2a\u5165\u53e3\u70b9\u7684\u623f\u95f4\u4e2d\u653e\u7f6e\u73a9\u5bb6\u3002\u5982\u679c\u73a9\u5bb6\u4e0d\u662f\u6301\u4e45\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u73a9\u5bb6\u653e\u5728\u623f\u95f4\u91cc\uff0c\u4f46\u5b83\u603b\u662f\u4ece\u540c\u4e00\u4e2a\u5730\u65b9\u5f00\u59cb\u3002\u5982\u679c\u73a9\u5bb6\u662f\u6301\u4e45\u7684\uff0c\u90a3\u4e48\u5f53\u4ed6\u4eec\u5207\u6362\u623f\u95f4\u65f6\uff0c\u4ed6\u4eec\u5c06\u4fdd\u6301\u5728\u4e0a\u4e00\u4e2a\u623f\u95f4\u4e2d\u7684\u5b8c\u5168\u76f8\u540c\u7684\u5750\u6807\u3002\u8fd9\u610f\u5473\u7740\u6211\u4eec\u9700\u8981\u5c06\u73a9\u5bb6\u91cd\u65b0\u5b9a\u4f4d\u5230\u6bcf\u4e2a\u623f\u95f4\u4e2d\u6211\u4eec\u9009\u62e9\u7684\u4f4d\u7f6e\u3002\n  <\/p>\n<p>\n   \u5982\u679c\u60a8\u7684\u6e38\u620f\u5c06\u6709\u5f88\u591a\u623f\u95f4\uff0c\u8fd9\u53ef\u80fd\u4f1a\u6210\u4e3a\u5f88\u591a\u5de5\u4f5c\u3002\u901a\u8fc7\u521b\u5efa\u81ea\u6211\u611f\u77e5\u7684\u4f20\u9001\u95e8\u548c\u4f7f\u7528\u623f\u95f4\u521b\u5efa\u4ee3\u7801\uff0c\u6709\u4e00\u79cd\u7b80\u5355\u7684\u89e3\u51b3\u65b9\u6cd5\u3002\n  <\/p>\n<h3>\n   <a id=\"_208\"><br \/>\n   <\/a><br \/>\n   \u8bbe\u7f6e\u623f\u95f4<br \/>\n  <\/h3>\n<p>\n   \u8ba9\u6211\u4eec\u4ece\u6784\u5efa\u4e00\u4e9b\u623f\u95f4\u5f00\u59cb\uff0c\u9996\u5148\u662f\u6807\u9898\u5c4f\u5e55\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u623f\u95f4\uff0c\u5728<br \/>\n     <strong><br \/>\n      \u8bbe\u7f6e<br \/>\n     <\/strong><br \/>\n     \u4e2d\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      TitleScreen<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u80cc\u666f\uff0c<br \/>\n     <code><br \/>\n      bg_Title<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Backgrounds\/Title.png<br \/>\n     <\/code><br \/>\n     \uff0c\u4e0d\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      TitleScreen<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      Backgrounds<br \/>\n     <\/strong><br \/>\n     \u9009\u9879\u5361\u4e2d\uff0c\u5c06<br \/>\n     <code><br \/>\n      bg_Title<br \/>\n     <\/code><br \/>\n     \u5e94\u7528\u4e3a<br \/>\n     <strong><br \/>\n      Background 0<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u52fe\u9009<br \/>\n     <strong><br \/>\n      Visible at Start<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u53e6\u4e00\u4e2a\u623f\u95f4\uff0c\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      C04_R01<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u91cc\u7684\u540d\u79f0\u4ee3\u8868\u7ae0\u8282\u548c\u623f\u95f4\uff0c\u5982\u7b2c\u56db\u7ae0\uff0c\u7b2c 1 \u623f\u95f4\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      Width<br \/>\n     <\/strong><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      Height<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      1024<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u6709\u5f88\u591a\u63a2\u7d22\u7a7a\u95f4\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u4e0d\u5e0c\u671b\u4e00\u6b21\u770b\u5230\u623f\u95f4\u4e2d\u7684\u6240\u6709\u4e1c\u897f\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u9650\u5236\u89c6\u56fe\u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      Views<br \/>\n     <\/strong><br \/>\n     \u9009\u9879\u5361\uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      Enable the Use of Views<br \/>\n     <\/strong><br \/>\n     \u3002\u9009\u62e9<br \/>\n     <strong><br \/>\n      View 0<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u52fe\u9009<br \/>\n     <strong><br \/>\n      Visible when room starts<br \/>\n     <\/strong><br \/>\n     \u3002\u8fd9\u5c06\u6fc0\u6d3b\u623f\u95f4\u7684\u6444\u50cf\u673a\u7cfb\u7edf\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u8fd8\u5e0c\u671b\u89c6\u56fe\u5173\u6ce8\u73a9\u5bb6\u5e76\u968f\u4e4b\u79fb\u52a8\u3002\u5728<br \/>\n     <strong><br \/>\n      Views<br \/>\n     <\/strong><br \/>\n     \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9<br \/>\n     <strong><br \/>\n      Object following<br \/>\n     <\/strong><br \/>\n     \u4e0b\u7684<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06**Vbor:<br \/>\n     <strong><br \/>\n      \u548c<br \/>\n     <\/strong><br \/>\n     Hbor:**\u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      200<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u5c06\u4f7f\u6444\u50cf\u673a\u8ddf\u968f\u73a9\u5bb6\uff0c\u5e76\u5728\u89c6\u56fe\u8fb9\u7f18\u7559\u4e0b 200 \u50cf\u7d20\u7684\u7f13\u51b2\u533a\u3002\u67e5\u770b\u4ee5\u4e0b\u622a\u56fe\uff0c\u786e\u4fdd\u4e00\u5207\u8bbe\u7f6e\u6b63\u786e\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u4f7f\u7528\u521a\u624d\u4e0e<br \/>\n     <code><br \/>\n      C04_R01<br \/>\n     <\/code><br \/>\n     \u76f8\u540c\u7684\u8bbe\u7f6e\uff0c\u521b\u5efa\u53e6\u5916\u4e24\u4e2a\u623f\u95f4<br \/>\n     <code><br \/>\n      C04_R02<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      C04_R03<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u8d44\u6e90\u6811\u4e2d\uff0c\u901a\u8fc7\u5c06<br \/>\n     <code><br \/>\n      Sandbox<br \/>\n     <\/code><br \/>\n     \u62d6\u52a8\u5230\u5e95\u90e8\u548c<br \/>\n     <code><br \/>\n      TitleScreen<br \/>\n     <\/code><br \/>\n     \u62d6\u52a8\u5230\u6700\u9876\u90e8\u6765\u91cd\u65b0\u6392\u5e8f\u623f\u95f4\u3002\u5b83\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4ee5\u4e0b\u622a\u56fe\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6700\u540e\uff0c\u4f7f\u7528\u5899\u5bf9\u8c61\u521b\u5efa\u4e00\u4e2a\u8ff7\u5bab\uff0c\u5305\u62ec\u6240\u6709\u4e09\u4e2a\u623f\u95f4\u3002\u8bbe\u8ba1\u76ee\u524d\u5e76\u4e0d\u91cd\u8981\uff1b\u53ea\u9700\u786e\u4fdd\u73a9\u5bb6\u80fd\u591f\u4ece\u4e00\u8fb9\u5230\u8fbe\u53e6\u4e00\u8fb9\u3002\u53ef\u4ee5\u5728\u4ee5\u4e0b\u622a\u56fe\u4e2d\u770b\u5230\u5b83\u53ef\u80fd\u7684\u6837\u5b50\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<h3>\n   <a id=\"_232\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u623f\u95f4\u4f20\u9001\u95e8<br \/>\n  <\/h3>\n<p>\n   \u4e3a\u4e86\u6539\u53d8\u623f\u95f4\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u53ef\u91cd\u590d\u4f7f\u7528\u7684\u4f20\u9001\u95e8\u3002\u6bcf\u4e2a\u4f20\u9001\u95e8\u5b9e\u9645\u4e0a\u7531\u4e24\u4e2a\u5355\u72ec\u7684\u5bf9\u8c61\u7ec4\u6210\uff0c\u4e00\u4e2a\u662f<br \/>\n   <strong><br \/>\n    Start<br \/>\n   <\/strong><br \/>\n   \u5bf9\u8c61\uff0c\u4e00\u4e2a\u662f<br \/>\n   <strong><br \/>\n    Exit<br \/>\n   <\/strong><br \/>\n   \u5bf9\u8c61\u3002<br \/>\n   <strong><br \/>\n    Start<br \/>\n   <\/strong><br \/>\n   \u5bf9\u8c61\u5c06\u4ee3\u8868\u73a9\u5bb6\u8fdb\u5165\u623f\u95f4\u65f6\u5e94\u8be5\u653e\u7f6e\u7684\u7740\u9646\u70b9\u3002<br \/>\n   <strong><br \/>\n    Exit<br \/>\n   <\/strong><br \/>\n   \u5bf9\u8c61\u662f\u6539\u53d8\u73a9\u5bb6\u6240\u5728\u623f\u95f4\u7684\u4f20\u9001\u5668\u3002\u6211\u4eec\u5c06\u5229\u7528\u56db\u4e2a\u72ec\u7279\u7684\u4f20\u9001\u95e8\uff0c\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u5728\u5730\u56fe\u7684\u6bcf\u4e00\u4fa7\u90fd\u6709\u4e00\u4e2a\u95e8\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e3a\u4e86\u4f7f\u623f\u95f4\u4f20\u9001\u7cfb\u7edf\u5de5\u4f5c\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u5168\u5c40\u53d8\u91cf\uff0c\u8fd9\u4e9b\u53d8\u91cf\u9700\u8981\u5728\u6e38\u620f\u5f00\u59cb\u65f6\u521d\u59cb\u5316\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Globals_StartGame<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">global<span class=\"token punctuation\">.<\/span>portalA <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalB <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalC <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalD <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">=<\/span> <span class=\"token constant\">C04_R01<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u4e3a\u56db\u4e2a\u4f20\u9001\u95e8\u521b\u5efa\u5168\u5c40\u53d8\u91cf\uff0c\u5e76\u7ed9\u5b83\u4eec\u4e00\u4e2a\u96f6\u503c\u3002\u6211\u4eec\u8fd8\u8ddf\u8e2a\u6211\u4eec\u4e0a\u6b21\u6240\u5728\u7684\u623f\u95f4\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u77e5\u9053\u6211\u4eec\u9700\u8981\u53bb\u65b0\u623f\u95f4\u7684\u54ea\u4e2a\u4f20\u9001\u95e8\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Globals<br \/>\n     <\/code><br \/>\n     \uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Game Start<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u9644\u52a0\u6b64\u811a\u672c\u3002\u8fd9\u4e2a\u5bf9\u8c61\u4e0d\u9700\u8981\u7cbe\u7075\uff0c\u56e0\u4e3a\u5b83\u53ea\u662f\u4e00\u4e2a\u6570\u636e\u5bf9\u8c61\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06\u4e00\u4e2a<br \/>\n     <code><br \/>\n      obj_Globals<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\u653e\u5165<br \/>\n     <code><br \/>\n      TitleScreen<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u9700\u8981\u80fd\u591f\u4ece\u6807\u9898\u5c4f\u5e55\u8fdb\u5165\u6e38\u620f\uff0c\u56e0\u6b64\u8ba9\u6211\u4eec\u901a\u8fc7\u6dfb\u52a0<br \/>\n     <strong><br \/>\n      Draw<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Globals_Draw<br \/>\n     <\/code><br \/>\n     \u6765\u5feb\u901f\u4fee\u590d\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">draw_set_color<\/span><span class=\"token punctuation\">(<\/span>c_white<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">draw_set_halign<\/span><span class=\"token punctuation\">(<\/span>fa_center<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">draw_text<\/span><span class=\"token punctuation\">(<\/span>room_width<span class=\"token operator\">\/<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">360<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">\"Press ANY key\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">keyboard_check_pressed<\/span><span class=\"token punctuation\">(<\/span>vk_anykey<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">room_goto_next<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u53ea\u662f\u7f16\u5199\u4e00\u4e9b\u767d\u8272\u7684\u5c45\u4e2d\u6587\u672c\uff0c\u8ba9\u73a9\u5bb6\u77e5\u9053\u4ed6\u4eec\u5982\u4f55\u5f00\u59cb\u6e38\u620f\u3002\u6211\u4eec\u4f7f\u7528\u7279\u6b8a\u53d8\u91cf<br \/>\n   <code><br \/>\n    vk_anykey<br \/>\n   <\/code><br \/>\n   \u6765\u67e5\u770b\u952e\u76d8\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u5982\u679c\u6309\u4e0b\u4e86\uff0c\u6211\u4eec\u5c31\u6309\u7167\u8d44\u6e90\u6811\u4e2d\u7684\u987a\u5e8f\u8fdb\u5165\u4e0b\u4e00\u4e2a\u623f\u95f4\u3002\n  <\/p>\n<h4>\n   <a id=\"_266\"><br \/>\n   <\/a><br \/>\n   \u6ce8\u610f<br \/>\n  <\/h4>\n<p>\n   \u60a8\u4e0d\u5fc5\u603b\u662f\u5173\u95ed\u811a\u672c\uff0c\u56e0\u4e3a\u5373\u4f7f\u6253\u5f00\u591a\u4e2a\u811a\u672c\u7a97\u53e3\uff0c\u6e38\u620f\u4e5f\u4f1a\u8fd0\u884c\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u5236\u4f5c\u4e00\u4e9b\u4f20\u9001\u95e8\uff01\u521b\u5efa\u4e00\u4e2a\u65b0\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Portal_A_Start<br \/>\n     <\/code><br \/>\n     \uff0c\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Portal_A_Start.png<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u53d6\u6d88\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\u5c45\u4e2d\u539f\u70b9\uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      OK<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Portal_A_Start<br \/>\n     <\/code><br \/>\n     \uff0c\u5c06\u7cbe\u7075\u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      spr_Portal_A_Start<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u662f\u6211\u4eec\u5c06\u73a9\u5bb6\u79fb\u52a8\u5230\u7684\u7740\u9646\u70b9\uff0c\u5f53\u4ed6\u4eec\u8fdb\u5165\u623f\u95f4\u65f6\u3002\u5b83\u4e0d\u9700\u8981\u4efb\u4f55\u4ee3\u7801\uff0c\u6240\u4ee5\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Portal_A_Exit<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Portal_A_Exit.png<br \/>\n     <\/code><br \/>\n     \uff0c\u53d6\u6d88<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u5c06\u539f\u70b9\u5c45\u4e2d\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Portal_A_Exit<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u76f8\u5e94\u5730\u8bbe\u7f6e\u7cbe\u7075\u3002\u8fd9\u662f\u5b9e\u9645\u7684\u4f20\u9001\u95e8\uff0c\u5f53\u73a9\u5bb6\u4e0e\u4e4b\u78b0\u649e\u65f6\uff0c\u6211\u4eec\u5c06\u6539\u53d8\u623f\u95f4\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5bf9\u4e8e<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u4e8b\u4ef6\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Portal_A_Exit_Collision<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">global<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">=<\/span> room<span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">room_goto<\/span><span class=\"token punctuation\">(<\/span>global<span class=\"token punctuation\">.<\/span>portalA<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u6211\u4eec\u53ef\u4ee5\u4f20\u9001\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5c06\u4e0a\u4e00\u4e2a\u623f\u95f4\u8bbe\u7f6e\u4e3a\u73a9\u5bb6\u5f53\u524d\u6240\u5728\u7684\u623f\u95f4\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u4f7f\u7528\u5185\u7f6e\u53d8\u91cf<br \/>\n   <code><br \/>\n    room<br \/>\n   <\/code><br \/>\n   \uff0c\u5b83\u5b58\u50a8\u6e38\u620f\u5f53\u524d\u663e\u793a\u7684\u623f\u95f4\u7684\u7d22\u5f15\u53f7\u3002\u4e4b\u540e\uff0c\u6211\u4eec\u53bb\u5230\u8fd9\u4e2a\u4f20\u9001\u95e8\u7684\u5168\u5c40\u53d8\u91cf\u6307\u793a\u6211\u4eec\u5e94\u8be5\u53bb\u7684\u623f\u95f4\u3002\n  <\/p>\n<ol>\n<li>\n    \u91cd\u590d\u6b65\u9aa4 5 \u5230 9\uff0c\u4e3a\u4f20\u9001\u95e8 B\u3001C \u548c D \u505a\u540c\u6837\u7684\u64cd\u4f5c\uff0c\u786e\u4fdd\u66f4\u6539\u6240\u6709\u9002\u5f53\u7684\u503c\u4ee5\u53cd\u6620\u6b63\u786e\u7684\u4f20\u9001\u95e8\u540d\u79f0\u3002\n   <\/li>\n<\/ol>\n<p>\n   \u4f20\u9001\u95e8\u5df2\u7ecf\u5b8c\u6210\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5b83\u4eec\u6dfb\u52a0\u5230\u623f\u95f4\u4e2d\u3002\u5728\u6bcf\u4e2a\u623f\u95f4\u4e2d\u4e0d\u5fc5\u4f7f\u7528\u6240\u6709\u56db\u4e2a\u4f20\u9001\u95e8\uff1b\u60a8\u53ea\u9700\u8981\u81f3\u5c11\u4e00\u4e2a\u8d77\u70b9\u548c\u4e00\u4e2a\u7ec8\u70b9\u3002\u5728\u653e\u7f6e\u8fd9\u4e9b\u5bf9\u8c61\u65f6\uff0c\u91cd\u8981\u7684\u662f\u540c\u4e00\u7c7b\u578b\u7684\u4f20\u9001\u95e8\u53ea\u80fd\u6709\u4e00\u4e2a\u3002\u8d77\u70b9\u4f20\u9001\u95e8\u5e94\u59cb\u7ec8\u653e\u7f6e\u5728\u53ef\u73a9\u533a\u57df\uff0c\u5e76\u786e\u4fdd\u53ea\u80fd\u4ece\u4e00\u4e2a\u65b9\u5411\u8bbf\u95ee\u7ec8\u70b9\u3002\u60a8\u8fd8\u5e94\u786e\u4fdd\uff0c\u5982\u679c\u4e00\u4e2a\u623f\u95f4\u7684<br \/>\n   <strong><br \/>\n    PORTAL A<br \/>\n   <\/strong><br \/>\n   \u5728\u5e95\u90e8\uff0c\u90a3\u4e48\u5b83\u8981\u8fdb\u5165\u7684\u623f\u95f4\u5e94\u8be5\u5728\u9876\u90e8\u6709<br \/>\n   <strong><br \/>\n    PORTAL A<br \/>\n   <\/strong><br \/>\n   \uff0c\u5982\u4e0b\u9762\u7684\u622a\u56fe\u6240\u793a\u3002\u8fd9\u5c06\u5e2e\u52a9\u73a9\u5bb6\u7406\u89e3\u4ed6\u4eec\u5728\u4e16\u754c\u4e2d\u7684\u4f4d\u7f6e\u3002\n  <\/p>\n<\/p>\n<p>\n   \u73b0\u5728\u662f\u6709\u8da3\u7684\u90e8\u5206\u3002\u6211\u4eec\u9700\u8981\u5728\u6bcf\u4e2a\u623f\u95f4\u4e2d\u66f4\u6539\u5168\u5c40\u4f20\u9001\u95e8\u6570\u503c\uff0c\u6211\u4eec\u4e0d\u60f3\u6709\u4e00\u4e2a\u68c0\u67e5\u6240\u6709\u623f\u95f4\u53d1\u751f\u60c5\u51b5\u7684\u5927\u578b\u811a\u672c\u3002\u76f8\u53cd\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u623f\u95f4\u672c\u8eab\u4f7f\u7528<br \/>\n   <strong><br \/>\n    \u521b\u5efa\u4ee3\u7801<br \/>\n   <\/strong><br \/>\n   \u6765\u5728\u73a9\u5bb6\u8fdb\u5165\u65f6\u66f4\u6539\u8fd9\u4e9b\u503c\u3002\u8ba9\u6211\u4eec\u5c1d\u8bd5\u4e00\u4e0b\uff0c\u901a\u8fc7\u4f7f<br \/>\n   <code><br \/>\n    C04_R01<br \/>\n   <\/code><br \/>\n   \u4e2d\u7684\u4f20\u9001\u95e8 A \u53bb\u5230<br \/>\n   <code><br \/>\n    C04_R02<br \/>\n   <\/code><br \/>\n   \uff0c\u53cd\u4e4b\u4ea6\u7136\u3002\n  <\/p>\n<ol>\n<li>\n    \u5728<br \/>\n    <code><br \/>\n     C04_R01<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     \u8bbe\u7f6e<br \/>\n    <\/strong><br \/>\n    \u9009\u9879\u5361\u4e2d\uff0c\u5355\u51fb<br \/>\n    <strong><br \/>\n     \u521b\u5efa\u4ee3\u7801<br \/>\n    <\/strong><br \/>\n    \u4ee5\u6253\u5f00\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">global<span class=\"token punctuation\">.<\/span>portalA <span class=\"token operator\">=<\/span> <span class=\"token constant\">C04_R02<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalB <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalC <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalD <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u5c06<br \/>\n   <strong><br \/>\n    PORTAL A<br \/>\n   <\/strong><br \/>\n   \u8bbe\u7f6e\u4e3a\u7b2c\u4e8c\u4e2a\u623f\u95f4\u3002\u6240\u6709\u5176\u4ed6\u4f20\u9001\u95e8\u90fd\u6ca1\u6709\u88ab\u4f7f\u7528\uff0c\u6240\u4ee5\u6211\u4eec\u5c06\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u96f6\u3002\u6bcf\u4e2a\u623f\u95f4\u90fd\u9700\u8981\u5c06\u6240\u6709\u8fd9\u4e9b\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u67d0\u4e2a\u503c\uff0c\u8981\u4e48\u662f\u7279\u5b9a\u7684\u623f\u95f4\uff0c\u8981\u4e48\u662f\u96f6\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002\n  <\/p>\n<ol>\n<li>\n    \u5728<br \/>\n    <code><br \/>\n     C04_R02<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     \u8bbe\u7f6e<br \/>\n    <\/strong><br \/>\n    \u9009\u9879\u5361\u4e2d\uff0c\u5355\u51fb<br \/>\n    <strong><br \/>\n     \u521b\u5efa\u4ee3\u7801<br \/>\n    <\/strong><br \/>\n    \u4ee5\u6253\u5f00\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">global<span class=\"token punctuation\">.<\/span>portalA <span class=\"token operator\">=<\/span> <span class=\"token constant\">C04_R01<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalB <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalC <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nglobal<span class=\"token punctuation\">.<\/span>portalD <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u5c06 PORTAL A \u8bbe\u7f6e\u4e3a\u7b2c\u4e00\u4e2a\u623f\u95f4\uff0c\u8fd9\u662f\u6709\u9053\u7406\u7684\u3002\u5982\u679c\u6211\u4eec\u901a\u8fc7\u90a3\u4e2a\u4f20\u9001\u95e8\uff0c\u6211\u4eec\u5e94\u8be5\u80fd\u591f\u518d\u6b21\u901a\u8fc7\u5b83\u56de\u53bb\u3002\u968f\u610f\u66f4\u6539\u8fd9\u4e9b\u8bbe\u7f6e\uff0c\u4ee5\u9002\u7528\u4e8e\u60a8\u60f3\u8981\u7684\u6240\u6709\u4f20\u9001\u95e8\u3002\n  <\/p>\n<h3>\n   <a id=\"_317\"><br \/>\n   <\/a><br \/>\n   \u4f20\u9001\u6301\u4e45\u73a9\u5bb6<br \/>\n  <\/h3>\n<p>\n   \u623f\u95f4\u90fd\u5df2\u7ecf\u5efa\u597d\uff0c\u51c6\u5907\u5c31\u7eea\u3002\u6211\u4eec\u552f\u4e00\u9700\u8981\u505a\u7684\u5c31\u662f\u8ba9\u73a9\u5bb6\u4ece\u4e00\u4e2a\u623f\u95f4\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u623f\u95f4\u3002\u8ba9\u6211\u4eec\u9996\u5148\u4f7f\u73a9\u5bb6\u6301\u4e45\uff0c\u8fd9\u6837\u6211\u4eec\u5728\u6e38\u620f\u4e2d\u53ea\u9700\u8981\u4e00\u4e2a\u73a9\u5bb6\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6253\u5f00<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u5e76\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u6301\u4e45<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u5c06\u73a9\u5bb6\u91cd\u65b0\u5b9a\u4f4d\u5230\u6b63\u786e\u7684\u4f20\u9001\u95e8\u3002\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_RoomStart<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5728<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      \u623f\u95f4\u5f00\u59cb<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>global<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">==<\/span> global<span class=\"token punctuation\">.<\/span>portalA<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>x <span class=\"token operator\">=<\/span> obj_Portal_A_Start<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">;<\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>y <span class=\"token operator\">=<\/span> obj_Portal_A_Start<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>global<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">==<\/span> global<span class=\"token punctuation\">.<\/span>portalB<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>x <span class=\"token operator\">=<\/span> obj_Portal_B_Start<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">;<\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>y <span class=\"token operator\">=<\/span> obj_Portal_B_Start<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>global<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">==<\/span> global<span class=\"token punctuation\">.<\/span>portalC<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>x <span class=\"token operator\">=<\/span> obj_Portal_C_Start<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">;<\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>y <span class=\"token operator\">=<\/span> obj_Portal_C_Start<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>global<span class=\"token punctuation\">.<\/span>lastRoom <span class=\"token operator\">==<\/span> global<span class=\"token punctuation\">.<\/span>portalD<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>x <span class=\"token operator\">=<\/span> obj_Portal_D_Start<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">;<\/span>\n    obj_Player<span class=\"token punctuation\">.<\/span>y <span class=\"token operator\">=<\/span> obj_Portal_D_Start<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> \n<\/code><\/pre>\n<p>\n   \u5f53\u73a9\u5bb6\u8fdb\u5165\u4e00\u4e2a\u623f\u95f4\u65f6\uff0c\u6211\u4eec\u68c0\u67e5\u73a9\u5bb6\u521a\u521a\u79bb\u5f00\u7684\u623f\u95f4\u4e0e\u54ea\u4e2a\u4f20\u9001\u95e8\u76f8\u5173\u8054\u3002\u7136\u540e\u5c06\u73a9\u5bb6\u79fb\u52a8\u5230\u9002\u5f53\u7684\u7740\u9646\u70b9\u3002\u4e3a\u4e86\u786e\u4fdd\u73a9\u5bb6\u88ab\u6b63\u786e\u6784\u5efa\uff0c\u5176\u5c5e\u6027\u5e94\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n  <\/p>\n<\/p>\n<ol>\n<li>\n<p>\n     \u5c06\u73a9\u5bb6\u5b9e\u4f8b\u653e\u5165<br \/>\n     <code><br \/>\n      C04_R01<br \/>\n     <\/code><br \/>\n     \u3002\u4e0d\u8981\u5c06\u73a9\u5bb6\u653e\u5165\u5176\u4ed6\u4efb\u4f55\u623f\u95f4\uff0c\u5426\u5219\u6e38\u620f\u4e2d\u5c06\u4f1a\u51fa\u73b0\u591a\u4e2a\u73a9\u5bb6\u5b9e\u4f8b\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u6211\u4eec\u5e94\u8be5\u80fd\u591f\u5728\u7b2c\u4e00\u4e2a\u623f\u95f4\u56db\u5904\u79fb\u52a8\uff0c\u5e76\u901a\u8fc7 A \u95e8\uff0c\u8fd9\u5c06\u628a\u6211\u4eec\u5e26\u5230\u7b2c\u4e8c\u4e2a\u623f\u95f4\u7684 A \u95e8\u7740\u9646\u70b9\u3002\u6709\u4e86\u8fd9\u4e2a\u7cfb\u7edf\uff0c\u4e00\u4e2a\u6e38\u620f\u53ef\u4ee5\u6709\u6570\u767e\u4e2a\u623f\u95f4\uff0c\u53ea\u9700\u8981\u56db\u4e2a\u4f20\u9001\u95e8\u6765\u7ba1\u7406\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<h2>\n   <a id=\"_350\"><br \/>\n   <\/a><br \/>\n   \u7ed9\u654c\u4eba\u751f\u547d<br \/>\n  <\/h2>\n<p>\n   \u654c\u4eba\u4e0d\u4ec5\u4ec5\u662f\u8981\u907f\u514d\u7684\u969c\u788d\u7269\u3002\u597d\u7684\u654c\u4eba\u8ba9\u73a9\u5bb6\u611f\u5230\u6709\u4e00\u4e9b\u6f5c\u5728\u7684<br \/>\n   <strong><br \/>\n    \u4eba\u5de5\u667a\u80fd<br \/>\n   <\/strong><br \/>\n   \uff08<br \/>\n   <strong><br \/>\n    AI<br \/>\n   <\/strong><br \/>\n   \uff09\u3002\u654c\u4eba\u4f3c\u4e4e\u77e5\u9053\u4f60\u4f55\u65f6\u9760\u8fd1\uff0c\u53ef\u4ee5\u5728\u5899\u4e0a\u8ffd\u9010\u4f60\uff0c\u5e76\u4e14\u53ef\u4ee5\u81ea\u884c\u5f98\u5f8a\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e09\u79cd\u751f\u7269\uff0c\u5b83\u4eec\u5c06\u5728\u4e16\u754c\u4e2d\u751f\u5b58\uff0c\u6bcf\u79cd\u90fd\u6709\u81ea\u5df1\u72ec\u7279\u7684 AI\u3002\n  <\/p>\n<h3>\n   <a id=\"_354\"><br \/>\n   <\/a><br \/>\n   \u53ec\u5524\u5e7d\u7075\u56fe\u4e66\u7ba1\u7406\u5458<br \/>\n  <\/h3>\n<p>\n   \u7b2c\u4e00\u4e2a\u751f\u7269\u5c06\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u8fc7\u671f\u7684 BookPile \u548c\u4fdd\u62a4\u5b83\u7684\u5e7d\u7075\u56fe\u4e66\u7ba1\u7406\u5458\u3002\u5982\u679c\u73a9\u5bb6\u9760\u8fd1\u4e00\u4e2a BookPile\uff0c\u5e7d\u7075\u5c06\u751f\u6210\u5e76\u8ffd\u9010\u73a9\u5bb6\u3002\u5982\u679c\u73a9\u5bb6\u79bb\u5e7d\u7075\u592a\u8fdc\uff0c\u5e7d\u7075\u5c06\u8fd4\u56de\u751f\u6210\u5b83\u7684 BookPile\u3002\u5982\u679c\u73a9\u5bb6\u653b\u51fb\u5e7d\u7075\uff0c\u5b83\u5c06\u6d88\u5931\u5e76\u4ece BookPile \u91cd\u65b0\u751f\u6210\u3002\u5982\u679c\u73a9\u5bb6\u6467\u6bc1 BookPile\uff0c\u751f\u6210\u7684\u5e7d\u7075\u4e5f\u5c06\u88ab\u6467\u6bc1\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u4ece BookPile \u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_BookPile<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/BookPile.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06\u539f\u70b9\u5c45\u4e2d\uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u8fd8\u9700\u8981\u4e00\u4e2a\u53ef\u6015\u7684\u58f0\u97f3\u6765\u8b66\u544a\u73a9\u5bb6\u5371\u9669\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u58f0\u97f3\uff0c<br \/>\n     <code><br \/>\n      snd_GhostMoan<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sounds\/GhostMoan.wav<br \/>\n     <\/code><br \/>\n     \u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_BookPile<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5206\u914d<br \/>\n     <code><br \/>\n      spr_BookPile<br \/>\n     <\/code><br \/>\n     \u4f5c\u4e3a\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u4e0d\u5e0c\u671b\u73a9\u5bb6\u80fd\u591f\u7a7f\u8fc7 BookPile\uff0c\u6240\u4ee5\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u56fa\u4f53<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u9700\u8981\u521d\u59cb\u5316\u4e00\u4e9b\u53d8\u91cf\uff0c\u6240\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_BookPile_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myRange <span class=\"token operator\">=<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">;<\/span>\nhasSpawned <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u7b2c\u4e00\u4e2a\u53d8\u91cf\u8bbe\u7f6e\u73a9\u5bb6\u9700\u8981\u591a\u63a5\u8fd1\u624d\u80fd\u53d8\u5f97\u6d3b\u8dc3\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf\u662f\u5e03\u5c14\u503c\uff0c\u5c06\u786e\u5b9a\u8fd9\u4e2a BookPile \u662f\u5426\u751f\u6210\u4e86\u5e7d\u7075\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u5e76\u5e94\u7528\u6b64\u811a\u672c\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_BookPile_Step<br \/>\n     <\/code><br \/>\n     \uff0c\u5b83\u5c06\u5e94\u7528\u4e8e<br \/>\n     <strong><br \/>\n      \u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>  \n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;<\/span> myRange <span class=\"token operator\">&amp;&amp;<\/span> hasSpawned <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        ghost <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Ghost<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        ghost<span class=\"token punctuation\">.<\/span>myBooks <span class=\"token operator\">=<\/span> self<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">;<\/span>\n        <span class=\"token function\">sound_play<\/span><span class=\"token punctuation\">(<\/span>snd_GhostMoan<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        hasSpawned <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>     \n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u4ee3\u7801\u7684\u7b2c\u4e00\u884c\u975e\u5e38\u91cd\u8981\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5b58\u5728\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5176\u4ed6\u64cd\u4f5c\u3002\u5982\u679c\u73a9\u5bb6\u5b58\u5728\uff0c\u6211\u4eec\u68c0\u67e5\u73a9\u5bb6\u5bf9\u8c61\u7684\u8ddd\u79bb\u662f\u5426\u5728\u8303\u56f4\u5185\uff0c\u4ee5\u53ca\u8fd9\u4e2a BookPile \u662f\u5426\u5df2\u7ecf\u751f\u6210\u4e86\u5e7d\u7075\u3002\u5982\u679c\u73a9\u5bb6\u5728\u8303\u56f4\u5185\u5e76\u4e14\u8fd8\u6ca1\u6709\u751f\u6210\u4efb\u4f55\u4e1c\u897f\uff0c\u6211\u4eec\u5c31\u751f\u6210\u4e00\u4e2a\u5e7d\u7075\u3002\u6211\u4eec\u8fd8\u4f1a\u5c06\u8fd9\u4e2a BookPile \u7684\u552f\u4e00 ID \u4f7f\u7528<br \/>\n   <code><br \/>\n    self<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u53d1\u9001\u5230\u5e7d\u7075\u4e2d\uff0c\u8fd9\u6837\u5b83\u5c31\u77e5\u9053\u81ea\u5df1\u6765\u81ea\u54ea\u91cc\u3002\u63a5\u4e0b\u6765\u64ad\u653e\u5e7d\u7075\u7684\u547b\u541f\u58f0\u97f3\uff0c\u786e\u4fdd\u4e0d\u8981\u5faa\u73af\u64ad\u653e\u3002\u6700\u540e\uff0c\u6211\u4eec\u901a\u8fc7\u5c06<br \/>\n   <code><br \/>\n    hasSpawned<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u66f4\u6539\u4e3a<br \/>\n   <code><br \/>\n    true<br \/>\n   <\/code><br \/>\n   \u6765\u6307\u793a\u6211\u4eec\u5df2\u7ecf\u751f\u6210\u4e86\u4e00\u4e2a\u5e7d\u7075\u3002\n  <\/p>\n<ol>\n<li>\n    \u552f\u4e00\u5269\u4e0b\u7684\u5143\u7d20\u662f\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <code><br \/>\n     obj_Player_Attack<br \/>\n    <\/code><br \/>\n    \u4e8b\u4ef6\uff0c\u4f7f\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_BookPile_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>ghost<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>ghost<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u518d\u6b21\uff0c\u6211\u4eec\u9996\u5148\u68c0\u67e5\u662f\u5426\u6709\u5e7d\u7075\u4ece\u8fd9\u4e2a BookPile \u751f\u6210\u5e76\u4e14\u4ecd\u7136\u5b58\u5728\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u9500\u6bc1\u90a3\u4e2a\u5e7d\u7075\uff0c\u7136\u540e\u79fb\u9664 BookPile \u672c\u8eab\u3002BookPile \u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\uff0c\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4ee5\u4e0b\u622a\u56fe\uff1a\n  <\/p>\n<\/p>\n<ol>\n<li>\n<p>\n     \u73b0\u5728\u6211\u4eec\u9700\u8981\u6784\u5efa\u5e7d\u7075\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9700\u8981\u5f15\u5165\u4e24\u4e2a\u7cbe\u7075\uff0c\u4e00\u4e2a\u7528\u4e8e\u751f\u6210\uff0c\u4e00\u4e2a\u7528\u4e8e\u8ffd\u9010\u3002\u521b\u5efa\u7cbe\u7075\u65f6\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \uff0c\u5206\u522b\u4e3a<br \/>\n     <code><br \/>\n      spr_Ghost<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Ghost_Spawn<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Ghost.gif<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Ghost_spawn.gif<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u4e24\u4e2a\u7cbe\u7075\u4e2d\uff0c\u5c06\u539f\u70b9\u5c45\u4e2d\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6\uff1a<br \/>\n      <strong><br \/>\n       \u5b57\u6bb5\u8bbe\u7f6e\u4e3a<br \/>\n       <code><br \/>\n        -50<br \/>\n       <\/code><br \/>\n       \uff0c\u8fd9\u6837\u5e7d\u7075\u5c06\u51fa\u73b0\u5728\u5927\u591a\u6570\u7269\u4f53\u4e0a\u65b9\uff0c\u4f46\u5728\u73a9\u5bb6\u653b\u51fb\u7269\u4f53\u4e0b\u65b9\u3002\u6ca1\u6709\u5176\u4ed6\u9700\u8981\u505a\u7684\u4e8b\u60c5\uff0c\u6240\u4ee5\u70b9\u51fb<br \/>\n      <\/strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Ghost<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5e94\u7528<br \/>\n     <code><br \/>\n      spr_Ghost_Spawn<br \/>\n     <\/code><br \/>\n     \u4f5c\u4e3a\u7cbe\u7075\u3002\u8fd9\u5c06\u4f7f\u751f\u6210\u52a8\u753b\u6210\u4e3a\u521d\u59cb\u7cbe\u7075\uff0c\u7136\u540e\u6211\u4eec\u5c06\u901a\u8fc7\u4ee3\u7801\u5c06\u5176\u66f4\u6539\u4e3a\u5e38\u89c4\u5e7d\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u6709\u51e0\u4e2a\u53d8\u91cf\u9700\u8981\u5728\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Ghost_Create<br \/>\n     <\/code><br \/>\n     \u4e2d\u521d\u59cb\u5316\uff0c\u5982\u4e0b\u6240\u793a\u7684\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\nmyRange <span class=\"token operator\">=<\/span> <span class=\"token number\">150<\/span><span class=\"token punctuation\">;<\/span>\nmyBooks <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nisDissolving <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.3<\/span><span class=\"token punctuation\">;<\/span> \n   alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u8bbe\u7f6e\u4e86\u79fb\u52a8\u901f\u5ea6\u7684\u53d8\u91cf\uff0c\u5e7d\u7075\u5c06\u5728\u5176\u4e2d\u8ffd\u8e2a\u7684\u8303\u56f4\uff0c\u751f\u6210\u5e7d\u7075\u7684\u4eba\uff08\u6211\u4eec\u5c06\u901a\u8fc7\u4e66\u5806\u6539\u53d8\uff09\uff0c\u4ee5\u53ca\u5e7d\u7075\u662f\u5426\u5df2\u7ecf\u8fd4\u56de\u5230\u4e66\u5806\u7684\u53d8\u91cf\u3002\u8bf7\u6ce8\u610f\uff0c\u5e7d\u7075\u7684\u8303\u56f4\u6bd4\u4e66\u5806\u7684\u8303\u56f4\u5927\u3002\u8fd9\u5c06\u786e\u4fdd\u5e7d\u7075\u7acb\u5373\u5f00\u59cb\u8ffd\u9010\u73a9\u5bb6\u3002\u7136\u540e\u6211\u4eec\u8bbe\u7f6e\u4e86\u52a8\u753b\u901f\u5ea6\uff0c\u5e76\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u516d\u6b65\u7684\u8b66\u62a5\uff0c\u6211\u4eec\u5c06\u7528\u5b83\u6765\u6539\u53d8\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Alarm0<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u7136\u540e\u5e94\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Ghost_Alarm0<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\u6765\u6539\u53d8\u7cbe\u7075\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">sprite_index <span class=\"token operator\">=<\/span> spr_Ghost<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u73b0\u5728\u6211\u4eec\u51c6\u5907\u5f00\u59cb\u5b9e\u73b0\u4e00\u4e9b\u4eba\u5de5\u667a\u80fd\u3002\u5e7d\u7075\u5c06\u662f\u6700\u57fa\u672c\u7684\u654c\u4eba\uff0c\u4f1a\u8ffd\u9010\u73a9\u5bb6\u7a7f\u8fc7\u623f\u95f4\uff0c\u5305\u62ec\u7a7f\u8fc7\u5899\u58c1\u548c\u5176\u4ed6\u654c\u4eba\uff0c\u76f4\u5230\u73a9\u5bb6\u8d85\u51fa\u8303\u56f4\u3002\u5728\u90a3\u65f6\uff0c\u5e7d\u7075\u5c06\u6f02\u6d6e\u56de\u5230\u5b83\u6765\u81ea\u7684\u4e66\u5806\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u5c06\u4ece\u8ffd\u9010\u73a9\u5bb6\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Ghost_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    targetDist <span class=\"token operator\">=<\/span> <span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;<\/span> myRange<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>       \n        <span class=\"token function\">move_towards_point<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>   \n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u786e\u4fdd\u73a9\u5bb6\u8fd8\u6d3b\u7740\u4e4b\u540e\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\u6765\u4fdd\u5b58\u5e7d\u7075\u5230\u73a9\u5bb6\u7684\u8ddd\u79bb\u3002\u6211\u4eec\u521b\u5efa<br \/>\n   <code><br \/>\n    targetDist<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u7684\u539f\u56e0\u662f\u6211\u4eec\u5c06\u9700\u8981\u8fd9\u4e2a\u4fe1\u606f\u51e0\u6b21\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u6bcf\u6b21\u6709<br \/>\n   <code><br \/>\n    if<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u65f6\u90fd\u91cd\u65b0\u68c0\u67e5\u8ddd\u79bb\u3002\u7136\u540e\u6211\u4eec\u6bd4\u8f83\u8ddd\u79bb\u548c\u8ffd\u9010\u8303\u56f4\uff0c\u5982\u679c\u73a9\u5bb6\u5728\u8303\u56f4\u5185\uff0c\u6211\u4eec\u5c31\u671d\u7740\u73a9\u5bb6\u79fb\u52a8\u3002<br \/>\n   <code><br \/>\n    move_towards_point<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u4f1a\u8ba1\u7b97\u65b9\u5411\u5e76\u5c06\u901f\u5ea6\u5e94\u7528\u5230\u8be5\u65b9\u5411\u7684\u5bf9\u8c61\u4e0a\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Step<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u5e76\u5e94\u7528\u8fd9\u4e2a\u811a\u672c\u3002\u6211\u4eec\u5c06\u7ee7\u7eed\u5411\u8fd9\u4e2a\u811a\u672c\u6dfb\u52a0\u4ee3\u7801\uff0c\u4f46\u5b83\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u4e86\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u82b1\u4e00\u70b9\u65f6\u95f4\u6765\u6d4b\u8bd5\u6211\u4eec\u5230\u76ee\u524d\u4e3a\u6b62\u6240\u505a\u7684\u4e00\u5207\u3002\u9996\u5148\uff0c\u5728\u8d44\u6e90\u6811\u4e2d\uff0c\u5c06<br \/>\n     <code><br \/>\n      Sandbox<br \/>\n     <\/code><br \/>\n     \u79fb\u5230\u63a5\u8fd1\u9876\u90e8\uff0c\u8fd9\u6837\u5b83\u5c31\u662f\u6807\u9898\u5c4f\u5e55\u540e\u7684\u623f\u95f4\u3002\u6253\u5f00<br \/>\n     <code><br \/>\n      Sandbox<br \/>\n     <\/code><br \/>\n     \u623f\u95f4\uff0c\u5e76\u50cf\u4ee5\u4e0b\u622a\u56fe\u6240\u793a\uff0c\u5728\u8fb9\u7f18\u653e\u7f6e\u51e0\u4e2a<br \/>\n     <code><br \/>\n      obj_BookPile<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u5982\u679c\u4f60\u79bb\u4e66\u5806\u592a\u8fd1\uff0c\u4e00\u4e2a\u5e7d\u7075\u4f1a\u4ece\u4e2d\u4ea7\u751f\uff0c\u5e76\u6162\u6162\u8ffd\u9010\u73a9\u5bb6\u3002\u5982\u679c\u73a9\u5bb6\u79bb\u5e7d\u7075\u592a\u8fdc\uff0c\u5e7d\u7075\u5c06\u7ee7\u7eed\u671d\u7740\u5b83\u6700\u540e\u7684\u65b9\u5411\u79fb\u52a8\uff0c\u5e76\u6700\u7ec8\u6d88\u5931\u5728\u5c4f\u5e55\u5916\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u5e7d\u7075\u8fd4\u56de\u5230\u5b83\u7684\u4e66\u5806\u3002\u5728<br \/>\n     <code><br \/>\n      scr_Ghost_Step<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u5230\u73a9\u5bb6\u5b58\u5728\u68c0\u67e5\u7684\u5927\u62ec\u53f7\u5185\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&gt;<\/span> myRange <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">distance_to_point<\/span><span class=\"token punctuation\">(<\/span>myBooks<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> myBooks<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>      \n<span class=\"token function\">move_towards_point<\/span><span class=\"token punctuation\">(<\/span>myBooks<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> myBooks<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\u6211\u4eec\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u8d85\u51fa\u8303\u56f4\uff0c\u800c\u5e7d\u7075\u53c8\u4e0d\u9760\u8fd1\u81ea\u5df1\u7684\u4e66\u5806\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<br \/>\n   <code><br \/>\n    distance_to_point<br \/>\n   <\/code><br \/>\n   \uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u662f\u68c0\u67e5\u4e66\u5806\u7684\u539f\u70b9\u800c\u4e0d\u662f<br \/>\n   <code><br \/>\n    distance_to_object<br \/>\n   <\/code><br \/>\n   \u4f1a\u5bfb\u627e\u7684\u78b0\u649e\u533a\u57df\u7684\u8fb9\u7f18\u3002\u5982\u679c\u8fd9\u4e00\u5207\u90fd\u662f\u771f\u7684\uff0c\u5e7d\u7075\u5c06\u5f00\u59cb\u5411\u5b83\u7684\u4e66\u5806\u79fb\u52a8\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u518d\u6b21\u8fd0\u884c\u6e38\u620f\u3002\u548c\u4ee5\u524d\u4e00\u6837\uff0c\u5e7d\u7075\u4f1a\u8ffd\u9010\u73a9\u5bb6\uff0c\u5982\u679c\u73a9\u5bb6\u79bb\u5f97\u592a\u8fdc\uff0c\u5e7d\u7075\u5c06\u8fd4\u56de\u5230\u5b83\u7684\u4e66\u5806\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5e7d\u7075\u6700\u7ec8\u4f1a\u5728\u4e66\u5806\u7684\u9876\u90e8\u6765\u56de\u79fb\u52a8\uff0c\u8fd9\u662f\u4e00\u4e2a\u95ee\u9898\u3002\u8fd9\u662f\u56e0\u4e3a\u5e7d\u7075\u5177\u6709\u57fa\u4e8e\u901f\u5ea6\u7684\u901f\u5ea6\uff0c\u5e76\u4e14\u6ca1\u6709\u4efb\u4f55\u4ee3\u7801\u544a\u8bc9\u5b83\u505c\u4e0b\u6765\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728\u6700\u540e\u7684<br \/>\n     <code><br \/>\n      else if<br \/>\n     <\/code><br \/>\n     \u8bed\u53e5\u540e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\nspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isDissolving <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n      myBooks<span class=\"token punctuation\">.<\/span>hasSpawned <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nsprite_index <span class=\"token operator\">=<\/span> spr_Ghost_Spawn<span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">;<\/span>\nisDissolving <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u91cc\u6709\u4e00\u4e2a\u6700\u7ec8\u7684<br \/>\n   <code><br \/>\n    else<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\uff0c\u5982\u679c\u73a9\u5bb6\u8d85\u51fa\u8303\u56f4\uff0c\u5e7d\u7075\u9760\u8fd1\u5b83\u7684\u4e66\u5806\uff0c\u5c06\u6267\u884c\u3002\u6211\u4eec\u9996\u5148\u505c\u6b62\u5e7d\u7075\u7684\u901f\u5ea6\u3002\u7136\u540e\u6211\u4eec\u68c0\u67e5\u5b83\u662f\u5426\u53ef\u4ee5\u6eb6\u89e3\u3002\u5982\u679c\u53ef\u4ee5\uff0c\u6211\u4eec\u544a\u8bc9\u4e66\u5806\u53ef\u4ee5\u518d\u6b21\u751f\u6210\u5e7d\u7075\uff0c\u6211\u4eec\u5c06\u7cbe\u7075\u6539\u56de\u751f\u6210\u52a8\u753b\uff0c\u5e76\u901a\u8fc7\u5c06<br \/>\n   <code><br \/>\n    image_speed<br \/>\n   <\/code><br \/>\n   \u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    -1<br \/>\n   <\/code><br \/>\n   \u6765\u4ee5\u76f8\u53cd\u7684\u65b9\u5f0f\u64ad\u653e\u8be5\u52a8\u753b\u3002\u6211\u4eec\u8fd8\u8bbe\u7f6e\u4e86\u53e6\u4e00\u4e2a\u8b66\u62a5\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u53ef\u4ee5\u5c06\u5e7d\u7075\u4ece\u4e16\u754c\u4e2d\u79fb\u9664\u5e76\u505c\u7528\u6eb6\u89e3\u68c0\u67e5\u3002\n  <\/p>\n<p>\n   \u6574\u4e2a<br \/>\n   <code><br \/>\n    scr_Ghost_Step<br \/>\n   <\/code><br \/>\n   \u5e94\u8be5\u5982\u4e0b\u6240\u793a\u7684\u4ee3\u7801\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\"> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    targetDist <span class=\"token operator\">=<\/span> <span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;<\/span> myRange<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>       \n        <span class=\"token function\">move_towards_point<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&gt;<\/span> myRange <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">distance_to_point<\/span><span class=\"token punctuation\">(<\/span>myBooks<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> myBooks<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>      \n        <span class=\"token function\">move_towards_point<\/span><span class=\"token punctuation\">(<\/span>myBooks<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> myBooks<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n        speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isDissolving <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            myBooks<span class=\"token punctuation\">.<\/span>hasSpawned <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n            sprite_index <span class=\"token operator\">=<\/span> spr_Ghost_Spawn<span class=\"token punctuation\">;<\/span>\n            image_speed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>\n            alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">;<\/span>\n            isDissolving <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u9700\u8981\u4e00\u4e2a\u6700\u540e\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Ghost_Alarm1<br \/>\n    <\/code><br \/>\n    \uff0c\u5b83\u9644\u52a0\u5728<br \/>\n    <strong><br \/>\n     Alarm 1<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e0a\uff0c\u5e76\u6709\u4e00\u884c\u4ee3\u7801\u6765\u79fb\u9664\u5b9e\u4f8b\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5e7d\u7075\u51e0\u4e4e\u5b8c\u6210\u4e86\u3002\u5b83\u751f\u6210\uff0c\u8ffd\u9010\u73a9\u5bb6\uff0c\u7136\u540e\u8fd4\u56de\u5230\u5b83\u7684 BookPile\uff0c\u4f46\u662f\u5982\u679c\u5b83\u6293\u4f4f\u4e86\u73a9\u5bb6\u4f1a\u53d1\u751f\u4ec0\u4e48\uff1f\u5bf9\u4e8e\u8fd9\u4e2a\u5e7d\u7075\uff0c\u6211\u4eec\u5e0c\u671b\u5b83\u649e\u5230\u73a9\u5bb6\uff0c\u9020\u6210\u4e00\u4e9b\u4f24\u5bb3\uff0c\u7136\u540e\u5728\u4e00\u56e2\u70df\u96fe\u4e2d\u6d88\u5931\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9700\u8981\u4e3a\u6b7b\u53bb\u7684\u5e7d\u7075\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u8d44\u6e90\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Ghost_Dead<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Ghost_Dead.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c45\u4e2d\u539f\u70b9\uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61<br \/>\n     <code><br \/>\n      obj_Ghost_Dead<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5e94\u7528\u8be5\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Ghost_Dead_AnimEnd<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\u5e76\u5c06\u5176\u9644\u52a0\u5230<br \/>\n     <strong><br \/>\n      \u52a8\u753b\u7ed3\u675f<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e0a\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   <strong><br \/>\n    \u52a8\u753b\u7ed3\u675f<br \/>\n   <\/strong><br \/>\n   \u4e8b\u4ef6\u5c06\u5728\u64ad\u653e\u7cbe\u7075\u7684\u6700\u540e\u4e00\u5e27\u56fe\u50cf\u65f6\u6267\u884c\u4ee3\u7801\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u70df\u96fe\u7684\u52a8\u753b\uff0c\u5728\u7ed3\u675f\u65f6\u5c06\u4ece\u6e38\u620f\u4e2d\u79fb\u9664\u5bf9\u8c61\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ea\u9700\u8981\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     obj_Ghost<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u6dfb\u52a0\u4e00\u4e2a\u5e26\u6709\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Ghost_Collision<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     obj_Player<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">health <span class=\"token operator\">-=<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span>\nmyBooks<span class=\"token punctuation\">.<\/span>hasSpawned <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Ghost_Dead<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u51cf\u5c11\u4e94\u70b9\u751f\u547d\u503c\uff0c\u7136\u540e\u544a\u8bc9\u5e7d\u7075\u7684 BookPile \u5b83\u53ef\u4ee5\u91cd\u65b0\u751f\u6210\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u521b\u5efa\u5e7d\u7075\u6b7b\u4ea1\u5bf9\u8c61\uff0c\u5f53\u6211\u4eec\u5c06\u5176\u4ece\u6e38\u620f\u4e2d\u79fb\u9664\u65f6\uff0c\u5b83\u5c06\u9690\u85cf\u771f\u6b63\u7684\u5e7d\u7075\u3002\u5982\u679c\u4e00\u5207\u6784\u5efa\u6b63\u786e\uff0c\u5b83\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4ee5\u4e0b\u622a\u56fe\uff1a\n  <\/p>\n<\/p>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u73b0\u5728\uff0c\u5e7d\u7075\u5e94\u8be5\u80fd\u591f\u5b8c\u5168\u6309\u7167\u8bbe\u8ba1\u7684\u65b9\u5f0f\u8fd0\u884c\u3002\u5b83\u4f1a\u751f\u6210\u5e76\u8ffd\u9010\u73a9\u5bb6\u3002\u5982\u679c\u5b83\u6293\u4f4f\u4e86\u73a9\u5bb6\uff0c\u5b83\u4f1a\u9020\u6210\u4f24\u5bb3\u5e76\u6d88\u5931\u3002\u5982\u679c\u73a9\u5bb6\u9003\u8131\uff0c\u5e7d\u7075\u5c06\u8fd4\u56de\u5230\u5b83\u7684 BookPile \u5e76\u6d88\u5931\u3002\u5e72\u5f97\u597d\uff01\n   <\/li>\n<\/ol>\n<p>\n   \u6700\u540e\u4e00\u4ef6\u4e8b\uff0c\u7531\u4e8e\u623f\u95f4\u662f\u7528\u6765\u8fdb\u884c\u5b9e\u9a8c\u800c\u4e0d\u662f\u5b9e\u9645\u6e38\u620f\u7684\u4e00\u90e8\u5206\uff0c\u6211\u4eec\u5e94\u8be5\u6e05\u7406\u623f\u95f4\uff0c\u4e3a\u4e0b\u4e00\u4e2a\u654c\u4eba\u505a\u51c6\u5907\u3002\n  <\/p>\n<ol>\n<li>\n    \u6253\u5f00<br \/>\n    <code><br \/>\n     Sandbox<br \/>\n    <\/code><br \/>\n    \u623f\u95f4\uff0c\u5e76\u5220\u9664\u6240\u6709\u7684 BookPiles \u5b9e\u4f8b\u3002\n   <\/li>\n<\/ol>\n<h3>\n   <a id=\"_Brawl_561\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u4e00\u4e2a\u6f2b\u6e38\u7684 Brawl<br \/>\n  <\/h3>\n<p>\n   \u6211\u4eec\u5c06\u521b\u5efa\u7684\u4e0b\u4e00\u4e2a\u654c\u4eba\u662f\u4e00\u4e2a Brawl\uff0c\u5b83\u5c06\u5728\u623f\u95f4\u91cc\u6f2b\u6e38\u3002\u5982\u679c\u73a9\u5bb6\u79bb\u8fd9\u4e2a\u654c\u4eba\u592a\u8fd1\uff0cBrawl \u4f1a\u53d8\u5f97\u6124\u6012\uff0c\u53d8\u5f97\u66f4\u5927\u5e76\u79fb\u52a8\u5f97\u66f4\u5feb\uff0c\u5c3d\u7ba1\u5b83\u4e0d\u4f1a\u79bb\u5f00\u5b83\u7684\u8def\u5f84\u3002\u4e00\u65e6\u73a9\u5bb6\u79bb\u5f00\u8303\u56f4\uff0c\u5b83\u4f1a\u6062\u590d\u51b7\u9759\uff0c\u5e76\u7f29\u5c0f\u5230\u539f\u6765\u7684\u5927\u5c0f\u548c\u901f\u5ea6\u3002\u73a9\u5bb6\u65e0\u6cd5\u6740\u6b7b\u8fd9\u4e2a\u654c\u4eba\uff0c\u4f46\u662f\u5982\u679c\u63a5\u89e6\u5230 Brawl\uff0c\u5b83\u4f1a\u5bf9\u73a9\u5bb6\u9020\u6210\u4f24\u5bb3\u3002\n  <\/p>\n<p>\n   \u5bf9\u4e8e Brawl\uff0c\u6211\u4eec\u5c06\u5229\u7528\u4e00\u4e2a\u8def\u5f84\uff0c\u5e76\u4e14\u6211\u4eec\u9700\u8981\u4e09\u4e2a\u7cbe\u7075\uff1a\u4e00\u4e2a\u7528\u4e8e\u6b63\u5e38\u72b6\u6001\uff0c\u4e00\u4e2a\u7528\u4e8e\u72b6\u6001\u8f6c\u6362\uff0c\u53e6\u4e00\u4e2a\u7528\u4e8e\u6124\u6012\u72b6\u6001\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Brawl_Small<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Brawl_Small.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u8fd9\u662f\u6b63\u5e38\u72b6\u6001\u7684\u7cbe\u7075\u3002\u5c45\u4e2d\u539f\u70b9\uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u53e6\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Brawl_Large<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Brawl_Large.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u6211\u4eec\u9700\u8981\u5c06\u539f\u70b9\u5c45\u4e2d\uff0c\u4ee5\u4fbf Brawl \u80fd\u591f\u6b63\u786e\u7f29\u653e\u8fd9\u4e2a\u56fe\u50cf\u3002\u6124\u6012\u72b6\u6001\u662f\u6b63\u5e38\u72b6\u6001\u7684\u4e24\u500d\u5927\u5c0f\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u8fd8\u9700\u8981\u5728\u8fd9\u4e24\u79cd\u72b6\u6001\u4e4b\u95f4\u8fdb\u884c\u8f6c\u6362\uff0c\u56e0\u6b64\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Brawl_Change<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Brawl_Change.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u4ecd\u7136\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u4e0d\u8981\u5fd8\u8bb0\u5c45\u4e2d\u539f\u70b9\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e2a Brawl \u8981\u9075\u5faa\u7684\u8def\u5f84\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u8def\u5f84\uff0c\u5e76\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      pth_Brawl_01<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b Brawl \u79fb\u52a8\u8d77\u6765\u66f4\u52a0\u5e73\u6ed1\uff0c\u56e0\u6b64\u5728<br \/>\n     <strong><br \/>\n      \u8fde\u63a5\u7c7b\u578b<br \/>\n     <\/strong><br \/>\n     \u4e0b\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5e73\u6ed1\u66f2\u7ebf<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <strong><br \/>\n      \u7cbe\u5ea6<br \/>\n     <\/strong><br \/>\n     \u66f4\u6539\u4e3a<br \/>\n     <code><br \/>\n      8<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8981\u770b\u770b\u6211\u4eec\u53ef\u4ee5\u7528\u8def\u5f84\u505a\u4e9b\u4ec0\u4e48\uff0c\u8ba9\u6211\u4eec\u5236\u4f5c\u4e00\u4e2a\u516b\u5b57\u5f62\u72b6\u7684\u8def\u5f84\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u8fd8\u521b\u5efa\u4e00\u4e2a\u65b0\u58f0\u97f3<br \/>\n     <code><br \/>\n      snd_Brawl<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sounds\/Brawl.wav<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61<br \/>\n     <code><br \/>\n      obj_Brawl<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Brawl_S<br \/>\n     <\/code><br \/>\n     \u5e94\u7528\u4e3a\u9ed8\u8ba4\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5c06\u4ece\u4e00\u4e2a\u521b\u5efa\u4e8b\u4ef6\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Brawl_Create<br \/>\n     <\/code><br \/>\n     \u4e2d\u521d\u59cb\u5316\u4e00\u4e9b\u53d8\u91cf\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\ncanGrow <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisBig <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">sound_play<\/span><span class=\"token punctuation\">(<\/span>snd_Brawl<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">sound_loop<\/span><span class=\"token punctuation\">(<\/span>snd_Brawl<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>pth_Brawl_01<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u7b2c\u4e00\u4e2a\u53d8\u91cf\u8bbe\u7f6e\u4e86 Brawl \u7684\u57fa\u672c\u901f\u5ea6\u3002\u63a5\u4e0b\u6765\u7684\u4e09\u4e2a\u53d8\u91cf\u662f\u53d8\u8eab\u548c\u6124\u6012\u72b6\u6001\u4ee5\u53ca\u662f\u5426\u5df2\u653b\u51fb\u7684\u68c0\u67e5\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u8bbe\u7f6e\u4e86\u52a8\u753b\u901f\u5ea6\uff0c\u7136\u540e\u64ad\u653e\u4e86 Brawl \u58f0\u97f3\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u58f0\u97f3\u5faa\u73af\u3002\u6700\u540e\uff0c\u6211\u4eec\u5c06 Brawl \u8bbe\u7f6e\u5230\u901f\u5ea6\u4e3a 2 \u7684\u8def\u5f84\u4e0a\uff1b\u5f53\u5b83\u5230\u8fbe\u8def\u5f84\u7684\u5c3d\u5934\u65f6\uff0c\u5b83\u5c06\u5faa\u73af\uff0c\u6700\u91cd\u8981\u7684\u662f\uff0c\u8def\u5f84\u8bbe\u7f6e\u4e3a\u7edd\u5bf9\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u5c06\u6309\u7167\u8def\u5f84\u7f16\u8f91\u5668\u4e2d\u8bbe\u8ba1\u7684\u65b9\u5f0f\u8fd0\u884c\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u5904\u7406 Brawl \u7684\u4eba\u5de5\u667a\u80fd\u3002\u4e3a<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n    <code><br \/>\n     scr_Brawl_Step<br \/>\n    <\/code><br \/>\n    \u7684\u65b0\u811a\u672c\uff0c\u6211\u4eec\u5c06\u4ece\u4f7f\u79fb\u52a8\u5de5\u4f5c\u5f00\u59cb\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">image_angle <span class=\"token operator\">=<\/span> direction<span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isBig <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    path_speed <span class=\"token operator\">=<\/span> mySpeed <span class=\"token operator\">*<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    path_speed <span class=\"token operator\">=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u901a\u8fc7\u65cb\u8f6c Sprite \u672c\u8eab\u6765\u4f7f\u5176\u9762\u5411\u6b63\u786e\u7684\u65b9\u5411\u3002\u8fd9\u5c06\u8d77\u4f5c\u7528\uff0c\u56e0\u4e3a\u6211\u4eec\u7684 Sprite \u56fe\u50cf\u9762\u5411\u53f3\u4fa7\uff0c\u8fd9\u4e0e\u96f6\u5ea6\u76f8\u540c\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u68c0\u67e5 Brawl \u662f\u5426\u53d8\u5927\u3002\u5982\u679c Brawl \u662f\u6124\u6012\u7248\u672c\uff0c\u6211\u4eec\u5c06\u8def\u5f84\u901f\u5ea6\u8bbe\u7f6e\u4e3a\u57fa\u672c\u901f\u5ea6\u7684\u4e24\u500d\u3002\u5426\u5219\uff0c\u6211\u4eec\u5c06\u901f\u5ea6\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7684\u57fa\u672c\u901f\u5ea6\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728\u623f\u95f4\u7684\u4efb\u4f55\u4f4d\u7f6e\u653e\u7f6e\u4e00\u4e2a Brawl \u5b9e\u4f8b\u5e76\u8fd0\u884c\u6e38\u620f\u3002Brawl \u5e94\u8be5\u56f4\u7ed5\u6570\u5b57\u516b\u79fb\u52a8\uff0c\u5e76\u6b63\u786e\u9762\u5411\u6b63\u786e\u7684\u65b9\u5411\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u53d8\u8eab\uff0c\u53d8\u5f97\u6124\u6012\u3002\u5728\u4e0a\u4e00\u884c\u4ee3\u7801\u4e4b\u540e\uff0c\u6dfb\u52a0\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canGrow <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">collision_line<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n            <span class=\"token punctuation\">{<!-- --><\/span>\n                sprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Change<span class=\"token punctuation\">;<\/span>\n                alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">;<\/span>\n                canGrow <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n            <span class=\"token punctuation\">}<\/span>      \n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u786e\u4fdd\u73a9\u5bb6\u5b58\u5728\uff0c\u7136\u540e\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5728\u8303\u56f4\u5185\u3002\u5982\u679c\u73a9\u5bb6\u5728\u8303\u56f4\u5185\uff0c\u6211\u4eec\u68c0\u67e5\u81ea\u5df1\u662f\u5426\u5df2\u7ecf\u6124\u6012\u3002\u5982\u679c Brawl \u8fd8\u6ca1\u6709\u53d8\u5927\uff0c\u6211\u4eec\u4f7f\u7528<br \/>\n   <code><br \/>\n    collision_line<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u6765\u67e5\u770b Brawl \u662f\u5426\u771f\u7684\u80fd\u770b\u5230\u73a9\u5bb6\u3002\u8fd9\u4e2a\u51fd\u6570\u5728\u4e24\u4e2a\u70b9\u4e4b\u95f4\u7ed8\u5236\u4e00\u6761\u7ebf\uff0c\u5373 Brawl \u548c\u73a9\u5bb6\u4f4d\u7f6e\uff0c\u7136\u540e\u786e\u5b9a\u4e00\u4e2a\u5bf9\u8c61\u5b9e\u4f8b\u6216\u5899\u58c1\u662f\u5426\u7a7f\u8fc7\u4e86\u8be5\u7ebf\u3002\u5982\u679c Brawl \u80fd\u770b\u5230\u73a9\u5bb6\uff0c\u6211\u4eec\u5c06 Sprite \u66f4\u6539\u4e3a\u53d8\u8eab Sprite\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u8b66\u62a5\u4ee5\u4fbf\u6211\u4eec\u53ef\u4ee5\u5b8c\u6210\u53d8\u8eab\uff0c\u5e76\u6307\u793a Brawl \u5df2\u7ecf\u53d8\u5927\u3002\n  <\/p>\n<ol>\n<li>\n    \u8ba9\u6211\u4eec\u4e3a<br \/>\n    <strong><br \/>\n     Alarm 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n    <code><br \/>\n     scr_Brawl_Alarm0<br \/>\n    <\/code><br \/>\n    \u7684\u811a\u672c\uff0c\u5176\u4e2d\u5305\u542b\u5c06\u5207\u6362\u5230\u6124\u6012\u7684 sprite \u5e76\u6307\u793a Brawl \u73b0\u5728\u5df2\u7ecf\u5b8c\u5168\u5927\u5c0f\u7684\u4ee3\u7801\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">sprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Large<span class=\"token punctuation\">;<\/span>\nisBig <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u4ee5\u786e\u4fdd\u4ee3\u7801\u6b63\u5e38\u5de5\u4f5c\u3002Brawl \u5e94\u8be5\u4fdd\u6301\u5c0f\u5c3a\u5bf8\uff0c\u76f4\u5230\u80fd\u6e05\u695a\u770b\u5230\u73a9\u5bb6\uff0c\u6b64\u65f6\u5b83\u5c06\u53d8\u6362\u4e3a\u5927\u578b\u3001\u6124\u6012\u7684 Brawl\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     Brawl \u6b63\u5728\u53d8\u5927\uff0c\u73b0\u5728\u6211\u4eec\u9700\u8981\u8ba9\u5b83\u5e73\u9759\u4e0b\u6765\u5e76\u7f29\u5c0f\u3002\u5728<br \/>\n     <code><br \/>\n      scr_Brawl_Step<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u6dfb\u52a0\u4e00\u4e2a\u8ddd\u79bb\u68c0\u67e5\u7684<br \/>\n     <code><br \/>\n      else<br \/>\n     <\/code><br \/>\n     \u8bed\u53e5\uff0c\u8be5\u8bed\u53e5\u5c06\u4f4d\u4e8e\u6700\u7ec8\u5927\u62ec\u53f7\u4e4b\u524d\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canGrow <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\nsprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Change<span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">;<\/span>\ncanGrow <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5982\u679c\u73a9\u5bb6\u8d85\u51fa\u8303\u56f4\uff0c\u8fd9\u4e2a<br \/>\n   <code><br \/>\n    else<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u5c06\u53d8\u4e3a\u6d3b\u52a8\u72b6\u6001\u3002\u6211\u4eec\u68c0\u67e5 Brawl \u662f\u5426\u4ecd\u7136\u5904\u4e8e\u6124\u6012\u72b6\u6001\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c06 Sprite \u66f4\u6539\u4e3a\u53d8\u8eab\u72b6\u6001\uff0c\u8bbe\u7f6e\u7b2c\u4e8c\u4e2a\u8b66\u62a5\uff0c\u5e76\u6307\u793a Brawl \u5df2\u6062\u590d\u6b63\u5e38\u3002\n  <\/p>\n<p>\n   \u4ee5\u4e0b\u662f\u5b8c\u6574\u7684<br \/>\n   <code><br \/>\n    scr_Brawl_Step<br \/>\n   <\/code><br \/>\n   \u811a\u672c\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\">image_angle <span class=\"token operator\">=<\/span> direction<span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isBig <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    path_speed <span class=\"token operator\">=<\/span> mySpeed <span class=\"token operator\">*<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    path_speed <span class=\"token operator\">=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canGrow <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">collision_line<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n            <span class=\"token punctuation\">{<!-- --><\/span>\n                sprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Change<span class=\"token punctuation\">;<\/span>\n                alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">;<\/span>\n                canGrow <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n            <span class=\"token punctuation\">}<\/span>      \n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span> \n    <span class=\"token keyword\">else<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canGrow <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            sprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Change<span class=\"token punctuation\">;<\/span>\n            alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">;<\/span>\n            canGrow <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u590d\u5236<br \/>\n    <code><br \/>\n     scr_Brawl_Alarm0<br \/>\n    <\/code><br \/>\n    \u811a\u672c\uff0c\u5c06\u5176\u547d\u540d\u4e3a<br \/>\n    <code><br \/>\n     scr_Brawl_Alarm1<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u6839\u636e\u4ee5\u4e0b\u4ee3\u7801\u8c03\u6574\u503c\u3002\u8bb0\u5f97\u5c06\u5176\u6dfb\u52a0\u4e3a<br \/>\n    <strong><br \/>\n     Alarm 1<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">sprite_index <span class=\"token operator\">=<\/span> spr_Brawl_Small<span class=\"token punctuation\">;<\/span>\nisBig <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u5e76\u786e\u8ba4\uff0c\u5f53\u73a9\u5bb6\u63a5\u8fd1\u5e76\u5728\u89c6\u7ebf\u8303\u56f4\u5185\u65f6\uff0cBrawl \u4f1a\u53d8\u5f97\u66f4\u5927\u66f4\u5feb\uff0c\u5e76\u5728\u8d85\u51fa\u8303\u56f4\u65f6\u6062\u590d\u6b63\u5e38\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u552f\u4e00\u5269\u4e0b\u7684\u5c31\u662f\u653b\u51fb\u3002\u4e3a<br \/>\n     <strong><br \/>\n      obj_Player<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n     <code><br \/>\n      scr_Brawl_Collision<br \/>\n     <\/code><br \/>\n     \u7684\u65b0\u811a\u672c\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isAttacking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    health <span class=\"token operator\">-=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n    isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5982\u679c\u73a9\u5bb6\u7b2c\u4e00\u6b21\u4e0e Brawl \u78b0\u649e\uff0c\u6211\u4eec\u4f1a\u51cf\u5c11 10 \u70b9\u751f\u547d\u503c\u5e76\u8bbe\u7f6e\u4e00\u4e2a\u4e24\u79d2\u7684\u8b66\u62a5\uff0c\u8ba9 Brawl \u53ef\u4ee5\u518d\u6b21\u653b\u51fb\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e3a\u4e86\u5b8c\u6210 Brawl\uff0c\u6211\u4eec\u53ea\u9700\u8981\u6700\u7ec8\u7684<br \/>\n    <strong><br \/>\n     Alarm 2<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u548c\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Brawl_Alarm2<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\u884c\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   Brawl \u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u5e76\u6309\u8bbe\u8ba1\u8fdb\u884c\u3002\u5982\u679c\u4e00\u5207\u5b9e\u73b0\u6b63\u786e\uff0c\u5bf9\u8c61\u5c5e\u6027\u5e94\u8be5\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n  <\/p>\n<\/p>\n<ol>\n<li>\n    \u4ece<br \/>\n    <code><br \/>\n     Sandbox<br \/>\n    <\/code><br \/>\n    \u623f\u95f4\u4e2d\u5220\u9664\u4efb\u4f55<br \/>\n    <code><br \/>\n     obj_Brawl<br \/>\n    <\/code><br \/>\n    \u5b9e\u4f8b\uff0c\u4ee5\u4fbf\u6211\u4eec\u53ef\u4ee5\u4e3a\u6700\u7ec8\u654c\u4eba\u91cd\u65b0\u5f00\u59cb\u3002\n   <\/li>\n<\/ol>\n<h3>\n   <a id=\"_732\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u6559\u7ec3<br \/>\n  <\/h3>\n<p>\n   \u6211\u4eec\u5c06\u521b\u5efa\u7684\u6700\u540e\u4e00\u4e2a\u654c\u4eba\uff0c\u6559\u7ec3\uff0c\u5c06\u662f\u8fc4\u4eca\u4e3a\u6b62\u6700\u5177\u6311\u6218\u6027\u7684\u5bf9\u624b\u3002\u8fd9\u4e2a\u654c\u4eba\u5c06\u5728\u623f\u95f4\u4e2d\u56db\u5904\u79fb\u52a8\uff0c\u968f\u673a\u5730\u4ece\u4e00\u4e2a\u5956\u676f\u5230\u53e6\u4e00\u4e2a\u5956\u676f\uff0c\u4ee5\u786e\u4fdd\u5956\u676f\u4ecd\u5728\u90a3\u91cc\u3002\u5982\u679c\u5b83\u770b\u5230\u73a9\u5bb6\uff0c\u5b83\u4f1a\u8ffd\u9010\u4ed6\u4eec\uff0c\u5982\u679c\u8db3\u591f\u63a5\u8fd1\uff0c\u5b83\u4f1a\u8fdb\u884c\u8fd1\u6218\u653b\u51fb\u3002\u5982\u679c\u73a9\u5bb6\u9003\u8131\uff0c\u5b83\u4f1a\u7b49\u4e00\u4f1a\u513f\u7136\u540e\u8fd4\u56de\u5c97\u4f4d\u3002\u6559\u7ec3\u6709\u4e00\u4e2a\u8eab\u4f53\uff0c\u6240\u4ee5\u5b83\u9700\u8981\u7ed5\u8fc7\u969c\u788d\u7269\uff0c\u751a\u81f3\u907f\u5f00\u5176\u4ed6\u6559\u7ec3\u3002\u8fd9\u4e5f\u610f\u5473\u7740\u5982\u679c\u73a9\u5bb6\u80fd\u591f\u653b\u51fb\u5b83\uff0c\u5b83\u53ef\u80fd\u4f1a\u6b7b\u4ea1\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u7531\u4e8e\u8fd9\u4e2a\u654c\u4eba\u6b63\u5728\u5b88\u536b\u67d0\u7269\uff0c\u6211\u4eec\u5c06\u4ece\u521b\u5efa\u5956\u676f\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Trophy<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Trophy.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u79fb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Trophy<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      scr_Trophy<br \/>\n     <\/code><br \/>\n     \u5e94\u7528\u4e3a\u5176\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7531\u4e8e\u8fd9\u662f\u4e00\u4e2a\u52a8\u753b\u7cbe\u7075\uff0c\u6211\u4eec\u5c06\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u901a\u8fc7\u5728\u65b0\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Trophy_Create<br \/>\n     <\/code><br \/>\n     \u4e2d\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\u6765\u4f7f\u5176\u4e0d\u8fdb\u884c\u52a8\u753b\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nimage_index <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u73b0\u5728\u5bf9\u4e8e\u5956\u676f\u6765\u8bf4\uff0c\u8fd9\u5c31\u662f\u6211\u4eec\u9700\u8981\u7684\u5168\u90e8\uff0c\u6240\u4ee5\u70b9\u51fb<br \/>\n    <strong><br \/>\n     \u786e\u5b9a<br \/>\n    <\/strong><br \/>\n    \u3002\n   <\/li>\n<\/ol>\n<p>\n   \u4e0e\u73a9\u5bb6\u4e00\u6837\uff0c\u6211\u4eec\u9700\u8981\u56db\u4e2a\u7cbe\u7075\uff0c\u4ee3\u8868\u654c\u4eba\u5c06\u79fb\u52a8\u7684\u56db\u4e2a\u65b9\u5411\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Coach_WalkRight<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Coach_WalkRight.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u79fb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06\u539f\u70b9\u5c45\u4e2d\uff0c\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u4fee\u6539\u63a9\u7801<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u5728<br \/>\n     <strong><br \/>\n      \u8fb9\u754c\u6846<br \/>\n     <\/strong><br \/>\n     \u4e0b\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5b8c\u6574\u56fe\u50cf<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5bf9\u4e8e<br \/>\n     <code><br \/>\n      spr_Coach_LWalkLeft<br \/>\n     <\/code><br \/>\n     \u3001<br \/>\n     <code><br \/>\n      spr_Coach_WalkDown<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Coach_WalkUp<br \/>\n     <\/code><br \/>\n     \u7cbe\u7075\uff0c\u91cd\u590d\u6b64\u8fc7\u7a0b\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Coach<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Coach_WalkRight<br \/>\n     <\/code><br \/>\n     \u5e94\u7528\u4e3a\u5176\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<p>\n   \u6211\u4eec\u5c06\u4e3a\u8fd9\u4e2a\u654c\u4eba\u52a8\u6001\u521b\u5efa\u8def\u5f84\uff0c\u4ee5\u4fbf\u5b83\u53ef\u4ee5\u81ea\u884c\u5bfc\u822a\u5230\u5956\u676f\u3002\u6211\u4eec\u8fd8\u5e0c\u671b\u5b83\u907f\u5f00\u969c\u788d\u7269\u548c\u5176\u4ed6\u654c\u4eba\u3002\u8fd9\u5e76\u4e0d\u96be\u5b9e\u73b0\uff0c\u4f46\u5728\u521d\u59cb\u5316\u65f6\u9700\u8981\u8fdb\u884c\u5927\u91cf\u8bbe\u7f6e\u3002\n  <\/p>\n<ol>\n<li>\n    \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Coach_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5c06\u5176\u5e94\u7528\u4e8e<br \/>\n    <strong><br \/>\n     \u521b\u5efa<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u7136\u540e\u6211\u4eec\u5c06\u4ece\u4e00\u4e9b\u57fa\u672c\u53d8\u91cf\u5f00\u59cb\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">;<\/span>\nisChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.3<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u518d\u6b21\uff0c\u6211\u4eec\u9996\u5148\u8bbe\u7f6e\u5bf9\u8c61\u7684\u901f\u5ea6\u3002\u7136\u540e\u6211\u4eec\u6709\u56db\u4e2a\u53d8\u91cf\uff0c\u8868\u793a\u6211\u4eec\u9700\u8981\u68c0\u67e5\u7684\u5404\u79cd\u72b6\u6001\uff0c\u5168\u90e8\u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    false<br \/>\n   <\/code><br \/>\n   \u3002\u6211\u4eec\u8fd8\u8bbe\u7f6e\u4e86\u7cbe\u7075\u7684\u52a8\u753b\u901f\u5ea6\u3002\n  <\/p>\n<p>\n   \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u8def\u5f84\u7cfb\u7edf\uff0c\u8be5\u7cfb\u7edf\u5c06\u5229\u7528 GameMaker \u7684\u4e00\u4e9b<br \/>\n   <strong><br \/>\n    \u8fd0\u52a8\u89c4\u5212<br \/>\n   <\/strong><br \/>\n   \u529f\u80fd\u3002\u57fa\u672c\u6982\u5ff5\u662f\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u8986\u76d6\u654c\u4eba\u79fb\u52a8\u533a\u57df\u7684\u7f51\u683c\u3002\u7136\u540e\u6211\u4eec\u627e\u5230\u6240\u6709\u6211\u4eec\u5e0c\u671b\u654c\u4eba\u907f\u5f00\u7684\u5bf9\u8c61\uff0c\u6bd4\u5982\u5899\u58c1\uff0c\u5e76\u5c06\u7f51\u683c\u7684\u8fd9\u4e9b\u533a\u57df\u6807\u8bb0\u4e3a\u7981\u533a\u3002\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u5728\u81ea\u7531\u533a\u57df\u4e2d\u5206\u914d\u8d77\u70b9\u548c\u76ee\u6807\u4f4d\u7f6e\uff0c\u5e76\u5728\u907f\u5f00\u969c\u788d\u7269\u7684\u60c5\u51b5\u4e0b\u521b\u5efa\u8def\u5f84\u3002\n  <\/p>\n<ol>\n<li>\n    \u5728<br \/>\n    <code><br \/>\n     scr_Coach_Create<br \/>\n    <\/code><br \/>\n    \u4e2d\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u5230\u811a\u672c\u7684\u672b\u5c3e\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myPath <span class=\"token operator\">=<\/span> <span class=\"token function\">path_add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nmyPathGrid <span class=\"token operator\">=<\/span> <span class=\"token function\">mp_grid_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> room_width<span class=\"token operator\">\/<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> room_height<span class=\"token operator\">\/<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">mp_grid_add_instances<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\u9700\u8981\u4e00\u4e2a\u7a7a\u8def\u5f84\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u4e8e\u6240\u6709\u672a\u6765\u7684\u8def\u5f84\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u7f51\u683c\uff0c\u8be5\u7f51\u683c\u5c06\u8bbe\u7f6e\u8def\u5f84\u5730\u56fe\u7684\u5c3a\u5bf8\u3002<br \/>\n   <code><br \/>\n    mp_grid_create<br \/>\n   <\/code><br \/>\n   \u5c5e\u6027\u6709\u53c2\u6570\uff0c\u7528\u4e8e\u786e\u5b9a\u5176\u5728\u4e16\u754c\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u6709\u591a\u5c11\u4e2a\u7f51\u683c\uff0c\u4ee5\u53ca\u6bcf\u4e2a\u7f51\u683c\u5355\u5143\u7684\u5927\u5c0f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4ece\u5de6\u4e0a\u89d2\u7684\u7f51\u683c\u5f00\u59cb\uff0c\u4ee5 32 \u50cf\u7d20\u7684\u589e\u91cf\u8986\u76d6\u6574\u4e2a\u623f\u95f4\u3002\u5c06\u623f\u95f4\u5c3a\u5bf8\u9664\u4ee5 32 \u610f\u5473\u7740\u8fd9\u5c06\u9002\u7528\u4e8e\u4efb\u4f55\u5c3a\u5bf8\u7684\u623f\u95f4\uff0c\u800c\u65e0\u9700\u8c03\u6574\u4ee3\u7801\u3002\u6700\u540e\uff0c\u6211\u4eec\u5c06\u5728\u623f\u95f4\u4e2d\u627e\u5230\u7684\u6240\u6709\u5899\u7684\u5b9e\u4f8b\u6dfb\u52a0\u5230\u7f51\u683c\u4e2d\uff0c\u4f5c\u4e3a\u4e0d\u5141\u8bb8\u8def\u5f84\u7684\u533a\u57df\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u4e3a\u6559\u7ec3\u627e\u5230\u4e00\u4e2a\u76ee\u7684\u5730\u3002\u7ee7\u7eed\u5728\u811a\u672c\u7684\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">nextLocation <span class=\"token operator\">=<\/span> <span class=\"token function\">irandom<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_number<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">)<\/span><span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ntarget <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_find<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">,<\/span> nextLocation<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncurrentLocation <span class=\"token operator\">=<\/span> nextLocation<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u5f97\u5230\u4e00\u4e2a\u57fa\u4e8e\u623f\u95f4\u4e2d\u5956\u676f\u6570\u91cf\u7684\u56db\u820d\u4e94\u5165\u968f\u673a\u6570\u3002\u8bf7\u6ce8\u610f\uff0c\u6211\u4eec\u4ece\u5956\u676f\u6570\u91cf\u4e2d\u51cf\u53bb\u4e86\u4e00\u4e2a\u3002\u6211\u4eec\u9700\u8981\u8fd9\u6837\u505a\uff0c\u56e0\u4e3a\u5728\u4e0b\u4e00\u884c\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<br \/>\n   <code><br \/>\n    instance_find<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u641c\u7d22\u7279\u5b9a\u5b9e\u4f8b\u3002\u8fd9\u4e2a\u51fd\u6570\u662f\u4ece\u6570\u7ec4\u4e2d\u63d0\u53d6\u7684\uff0c\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u9879\u603b\u662f\u4ece\u96f6\u5f00\u59cb\u3002\u6700\u540e\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u7b2c\u4e8c\u4e2a\u53d8\u91cf\uff0c\u7528\u4e8e\u5f53\u6211\u4eec\u60f3\u8981\u6539\u53d8\u76ee\u7684\u5730\u65f6\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u6240\u8981\u505a\u7684\u5c31\u662f\u521b\u5efa\u8def\u5f84\u5e76\u4f7f\u7528\u5b83\u3002\u5728\u811a\u672c\u7684\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">mp_grid_path<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> myPath<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>myPath<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9009\u62e9\u4e86\u6211\u4eec\u521b\u5efa\u7684\u7f51\u683c\u548c\u7a7a\u8def\u5f84\uff0c\u5e76\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u8def\u5f84\uff0c\u8be5\u8def\u5f84\u4ece\u6559\u7ec3\u7684\u4f4d\u7f6e\u5230\u76ee\u6807\u4f4d\u7f6e\uff0c\u5e76\u4e14\u4e0d\u4f1a\u5bf9\u89d2\u7ebf\u79fb\u52a8\u3002\u7136\u540e\u6211\u4eec\u8ba9\u6559\u7ec3\u52a8\u8d77\u6765\uff0c\u8fd9\u4e00\u6b21\uff0c\u5f53\u5b83\u5230\u8fbe\u8def\u5f84\u7684\u5c3d\u5934\u65f6\uff0c\u5b83\u5c06\u505c\u4e0b\u6765\u3002<br \/>\n   <code><br \/>\n    path_start<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u4e2d\u7684\u6700\u7ec8\u503c\u5c06\u8def\u5f84\u8bbe\u7f6e\u4e3a\u7edd\u5bf9\u503c\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u6211\u4eec\u9700\u8981\u8fd9\u6837\u505a\uff0c\u56e0\u4e3a\u8def\u5f84\u662f\u52a8\u6001\u521b\u5efa\u7684\u3002\n  <\/p>\n<p>\n   \u8fd9\u662f\u6574\u4e2a<br \/>\n   <code><br \/>\n    scr_Coach_Create<br \/>\n   <\/code><br \/>\n   \u811a\u672c\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">;<\/span>\nisChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nimage_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.3<\/span><span class=\"token punctuation\">;<\/span>\n\nmyPath <span class=\"token operator\">=<\/span> <span class=\"token function\">path_add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nmyPathGrid <span class=\"token operator\">=<\/span> <span class=\"token function\">mp_grid_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> room_width<span class=\"token operator\">\/<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> room_height<span class=\"token operator\">\/<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">mp_grid_add_instances<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\nnextLocation <span class=\"token operator\">=<\/span> <span class=\"token function\">irandom<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_number<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">)<\/span><span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ntarget <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_find<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">,<\/span> nextLocation<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncurrentLocation <span class=\"token operator\">=<\/span> nextLocation<span class=\"token punctuation\">;<\/span>\n\n<span class=\"token function\">mp_grid_path<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> myPath<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>myPath<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> \n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u6253\u5f00 Sandbox\uff0c\u5728\u89d2\u843d\u653e\u7f6e\u4e24\u4e2a<br \/>\n     <code><br \/>\n      obj_Coach<br \/>\n     <\/code><br \/>\n     \u5b9e\u4f8b\uff0c\u4ee5\u53ca\u4e09\u4e2a<br \/>\n     <code><br \/>\n      obj_Trophy<br \/>\n     <\/code><br \/>\n     \u5b9e\u4f8b\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u60a8\u5e94\u8be5\u770b\u5230\u6559\u7ec3\u4eec\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u5956\u676f\u5e76\u671d\u5b83\u79fb\u52a8\u3002\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u51e0\u6b21\uff0c\u770b\u770b\u6bcf\u4e2a\u6559\u7ec3\u6240\u91c7\u53d6\u7684\u4e0d\u540c\u8def\u5f84\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u57fa\u672c\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u7ee7\u7eed\u8fdb\u884c AI\u3002\u6211\u4eec\u5c06\u4ece\u6839\u636e\u79fb\u52a8\u65b9\u5411\u5207\u6362\u7cbe\u7075\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Coach_Step<br \/>\n     <\/code><br \/>\n     \uff0c\u5c06\u5176\u5e94\u7528\u4e8e<br \/>\n     <strong><br \/>\n      Step<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">45<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">135<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkUp<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">135<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">225<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkLeft<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">225<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">315<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkDown<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkRight<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6839\u636e\u5b9e\u4f8b\u79fb\u52a8\u7684\u65b9\u5411\u66f4\u6539\u7cbe\u7075\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u8fd9\u91cc\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u56e0\u4e3a\u6211\u4eec\u4e0d\u5141\u8bb8\u5728\u8def\u5f84\u4e0a\u8fdb\u884c\u5bf9\u89d2\u7ebf\u79fb\u52a8\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8ba9\u6559\u7ec3\u89c2\u5bdf\u73a9\u5bb6\uff0c\u5982\u679c\u88ab\u53d1\u73b0\uff0c\u4ed6\u4eec\u5c06\u79bb\u5f00\u539f\u6765\u7684\u8def\u5f84\u8fdb\u884c\u8ffd\u9010\u3002\u5728\u7cbe\u7075\u66f4\u6539\u4ee3\u7801\u4e4b\u540e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">targetDist <span class=\"token operator\">=<\/span> <span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">150<\/span>  <span class=\"token operator\">&amp;&amp;<\/span> targetDist <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canSee <span class=\"token operator\">=<\/span> <span class=\"token function\">collision_line<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canSee <span class=\"token operator\">==<\/span> noone<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token function\">mp_potential_step<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        isChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u518d\u6b21\u4f7f\u7528\u4e00\u4e2a\u53d8\u91cf\u6765\u4fdd\u5b58\u73a9\u5bb6\u8ddd\u79bb\u7684\u503c\uff0c\u4ee5\u8282\u7701\u7f16\u7801\u65f6\u95f4\u5e76\u6700\u5c0f\u5316\u51fd\u6570\u8c03\u7528\u3002\u5982\u679c\u73a9\u5bb6\u5728\u8303\u56f4\u5185\u4e14\u4e0d\u5728\u653b\u51fb\u8ddd\u79bb\u5185\uff0c\u6211\u4eec\u8fdb\u884c\u89c6\u7ebf\u68c0\u67e5\u3002<br \/>\n   <code><br \/>\n    collision_line<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u8fd4\u56de\u7ebf\u7a7f\u8fc7\u7684\u4efb\u4f55\u5899\u5b9e\u4f8b\u7684 ID\u3002\u5982\u679c\u5b83\u4e0d\u4e0e\u4efb\u4f55\u5899\u5b9e\u4f8b\u76f8\u4ea4\uff0c\u5b83\u5c06\u8fd4\u56de\u4e00\u4e2a\u540d\u4e3a<br \/>\n   <code><br \/>\n    noone<br \/>\n   <\/code><br \/>\n   \u7684\u7279\u6b8a\u53d8\u91cf\u3002\u5982\u679c\u73a9\u5bb6\u5728\u89c6\u7ebf\u4e2d\uff0c\u6211\u4eec\u7ed3\u675f\u6559\u7ec3\u6b63\u5728\u9075\u5faa\u7684\u8def\u5f84\uff0c\u5e76\u5f00\u59cb\u671d\u73a9\u5bb6\u79fb\u52a8\u3002<br \/>\n   <code><br \/>\n    mp_potential_step<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u5c06\u4f7f\u5bf9\u8c61\u671d\u7740\u671f\u671b\u7684\u65b9\u5411\u79fb\u52a8\uff0c\u540c\u65f6\u907f\u5f00\u969c\u788d\u7269\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u907f\u5f00\u6240\u6709\u5b9e\u4f8b\u3002\u6700\u540e\uff0c\u6211\u4eec\u6307\u793a\u6559\u7ec3\u6b63\u5728\u8ffd\u9010\u73a9\u5bb6\u3002\n  <\/p>\n<ol>\n<li>\n    \u8fd9\u5bf9\u4e8e\u5f00\u59cb\u8ffd\u9010\u5f88\u6709\u6548\uff0c\u4f46\u662f\u5982\u679c\u73a9\u5bb6\u9003\u8131\u4e86\u600e\u4e48\u529e\uff1f\u8ba9\u6559\u7ec3\u7b49\u5f85\u4e00\u4f1a\u513f\uff0c\u7136\u540e\u56de\u5230\u5de1\u903b\u3002\u5728\u8fdb\u884c\u89c6\u7ebf\u68c0\u67e5\u7684<br \/>\n    <code><br \/>\n     else<br \/>\n    <\/code><br \/>\n    \u8bed\u53e5\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canSee <span class=\"token operator\">!=<\/span> noone <span class=\"token operator\">&amp;&amp;<\/span> isChasing <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n    isWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    isChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u4e2a<br \/>\n   <code><br \/>\n    else<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u8868\u793a\uff0c\u5982\u679c\u73a9\u5bb6\u770b\u4e0d\u89c1\u5e76\u4e14\u6559\u7ec3\u6b63\u5728\u8ffd\u9010\uff0c\u5b83\u5c06\u8bbe\u7f6e\u4e00\u4e2a\u8b66\u62a5\u4ee5\u5bfb\u627e\u65b0\u76ee\u7684\u5730\uff0c\u544a\u8bc9\u5b83\u7b49\u5f85\uff0c\u8ffd\u9010\u7ed3\u675f\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u8b66\u62a5\uff0c\u56e0\u6b64\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Coach_Alarm0<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u5e94\u7528\u4e8e<br \/>\n    <strong><br \/>\n     Alarm 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u3002\u5728\u811a\u672c\u4e2d\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>nextLocation <span class=\"token operator\">==<\/span> currentLocation<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    nextLocation <span class=\"token operator\">=<\/span> <span class=\"token function\">irandom<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_number<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">)<\/span><span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\ntarget <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_find<\/span><span class=\"token punctuation\">(<\/span>obj_Trophy<span class=\"token punctuation\">,<\/span> nextLocation<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncurrentLocation <span class=\"token operator\">=<\/span> nextLocation<span class=\"token punctuation\">;<\/span>\n\n<span class=\"token function\">mp_grid_path<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> myPath<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>myPath<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\nisWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u4f7f\u7528\u4e00\u4e2a<br \/>\n   <code><br \/>\n    while<br \/>\n   <\/code><br \/>\n   \u5faa\u73af\u6765\u68c0\u67e5\u4e0b\u4e00\u4e2a\u4f4d\u7f6e\u662f\u5426\u4e0e\u65e7\u4f4d\u7f6e\u76f8\u540c\u3002\u8fd9\u5c06\u786e\u4fdd\u6559\u7ec3\u603b\u662f\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u5956\u676f\u3002\u5c31\u50cf\u6211\u4eec\u5728\u521d\u59cb\u8bbe\u7f6e\u4e2d\u6240\u505a\u7684\u90a3\u6837\uff0c\u6211\u4eec\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u76ee\u6807\u5e76\u8bbe\u7f6e\u5f53\u524d\u4f4d\u7f6e\u53d8\u91cf\u3002\u6211\u4eec\u8fd8\u521b\u5efa\u4e00\u4e2a\u8def\u5f84\u5e76\u5f00\u59cb\u5728\u5176\u4e0a\u79fb\u52a8\uff0c\u8fd9\u610f\u5473\u7740\u6559\u7ec3\u4e0d\u518d\u7b49\u5f85\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u8fd8\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u5143\u7d20\u5230\u8ffd\u9010\u5e8f\u5217\u4e2d\uff0c\u5373\u653b\u51fb\u3002\u5982\u679c\u6559\u7ec3\u9760\u8fd1\u73a9\u5bb6\uff0c\u5b83\u5e94\u8be5\u5bf9\u73a9\u5bb6\u8fdb\u884c\u8fd1\u6218\u653b\u51fb\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Coach_Attack<br \/>\n     <\/code><br \/>\n     \uff0c\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 4\/Sprites\/Coach_Attack.gif<br \/>\n     <\/code><br \/>\n     \u5e76\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c31\u50cf\u73a9\u5bb6\u7684\u653b\u51fb\u4e00\u6837\uff0c\u5c06<br \/>\n     <strong><br \/>\n      Origin<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      -16<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      Y:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      24<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u8c03\u6574<br \/>\n     <strong><br \/>\n      Bounding Box<br \/>\n     <\/strong><br \/>\n     \u7684\u503c\u4e3a<br \/>\n     <strong><br \/>\n      Left:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      Right:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      24<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      Top:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \uff0c\u548c<br \/>\n     <strong><br \/>\n      Bottom:<br \/>\n     <\/strong><br \/>\n     <code><br \/>\n      4<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61<br \/>\n     <code><br \/>\n      obj_Coach_Attack<br \/>\n     <\/code><br \/>\n     \uff0c\u5e94\u7528\u7cbe\u7075\uff0c\u5e76\u5c06<br \/>\n     <strong><br \/>\n      Depth<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -100<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Coach_Attack_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u63a7\u5236\u52a8\u753b\u901f\u5ea6\u7684\u4ee3\u7801\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u7528\u4e8e\u79fb\u9664\u5b9e\u4f8b\u7684\u8b66\u62a5\uff0c\u5e76\u4e00\u4e2a\u6211\u4eec\u53ef\u4ee5\u6253\u5f00\u7684\u53d8\u91cf\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.3<\/span><span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">;<\/span>\nisHit <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u4f7f\u7528\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Coach_Attack_Alarm0<br \/>\n    <\/code><br \/>\n    \u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Alarm 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u8be5\u811a\u672c\u4f1a\u79fb\u9664\u5b9e\u4f8b\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u6700\u540e\uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     obj_Player<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Coach_Attack_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isHit <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    health <span class=\"token operator\">-=<\/span> <span class=\"token number\">15<\/span><span class=\"token punctuation\">;<\/span>\n    isHit <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5982\u679c\u8fd9\u662f\u7b2c\u4e00\u6b21\u78b0\u649e\uff0c\u6211\u4eec\u51cf\u5c11\u4e00\u70b9\u751f\u547d\u503c\uff0c\u7136\u540e\u505c\u7528\u6b64\u68c0\u67e5\u3002\n  <\/p>\n<ol>\n<li>\n    \u653b\u51fb\u5df2\u7ecf\u5b8c\u6210\u3002\u73b0\u5728\u8981\u5728\u6559\u7ec3\u4e2d\u6fc0\u6d3b\u5b83\uff0c\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Coach_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u6700\u540e\u7684\u5927\u62ec\u53f7\u540e\u6dfb\u52a0\u653b\u51fb\u4ee3\u7801\u4f5c\u4e3a<br \/>\n    <code><br \/>\n     else if<br \/>\n    <\/code><br \/>\n    \u8bed\u53e5\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isAttacking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        swing <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Coach_Attack<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        swing<span class=\"token punctuation\">.<\/span>image_angle <span class=\"token operator\">=<\/span> direction<span class=\"token punctuation\">;<\/span>\n        alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span>\n        isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5982\u679c\u6559\u7ec3\u9760\u8fd1\u73a9\u5bb6\u4f46\u5c1a\u672a\u53d1\u52a8\u653b\u51fb\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u6559\u7ec3\u653b\u51fb\u7684\u5b9e\u4f8b\u3002\u7136\u540e\u6211\u4eec\u65cb\u8f6c\u653b\u51fb\u7cbe\u7075\uff0c\u4f7f\u5176\u9762\u5411\u4e0e\u6559\u7ec3\u76f8\u540c\u7684\u65b9\u5411\u3002\u8bbe\u7f6e\u4e00\u4e2a\u4e09\u79d2\u7684\u95f9\u949f\uff0c\u4ee5\u4fbf\u5728\u518d\u6b21\u8fd0\u884c\u6b64\u4ee3\u7801\u4e4b\u524d\u6709\u65f6\u95f4\u5598\u53e3\u6c14\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Alarm 1<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u6765\u91cd\u7f6e\u653b\u51fb\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Coach_Alarm1<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5173\u95ed\u653b\u51fb\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u73b0\u5728\u6559\u7ec3\u4f1a\u8ffd\u9010\u73a9\u5bb6\uff0c\u5982\u679c\u5b83\u9760\u8fd1\u73a9\u5bb6\u8db3\u591f\u8fd1\uff0c\u5b83\u5c31\u4f1a\u53d1\u52a8\u653b\u51fb\u3002\n   <\/li>\n<\/ol>\n<p>\n   \u6559\u7ec3\u73b0\u5728\u53ea\u5b8c\u6210\u4e86\u4e00\u534a\u7684\u5de5\u4f5c\uff0c\u8ffd\u9010\u73a9\u5bb6\u3002\u6211\u4eec\u8fd8\u9700\u8981\u6dfb\u52a0\u6b63\u5e38\u7684\u5de1\u903b\u4efb\u52a1\u3002\u76ee\u524d\uff0c\u5982\u679c\u6559\u7ec3\u770b\u4e0d\u5230\u73a9\u5bb6\u5e76\u4e14\u5230\u8fbe\u8def\u5f84\u7684\u5c3d\u5934\uff0c\u5b83\u5c31\u4f1a\u505c\u4e0b\u6765\u518d\u6b21\u4ec0\u4e48\u90fd\u4e0d\u505a\u3002\u5b83\u5e94\u8be5\u53ea\u7b49\u51e0\u79d2\uff0c\u7136\u540e\u7ee7\u7eed\u79fb\u52a8\u5230\u4e0b\u4e00\u4e2a\u5956\u676f\u3002\n  <\/p>\n<ol>\n<li>\n    \u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Coach_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u811a\u672c\u7684\u6700\u540e\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <code><br \/>\n     else<br \/>\n    <\/code><br \/>\n    \u8bed\u53e5\uff0c\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">else<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isWaiting <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">)<\/span> \n        <span class=\"token punctuation\">{<!-- --><\/span>\n            alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n            <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n            isWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u4e2a<br \/>\n   <code><br \/>\n    else<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u8868\u793a\u73a9\u5bb6\u8d85\u51fa\u8303\u56f4\u3002\u7136\u540e\u6211\u4eec\u68c0\u67e5\u6559\u7ec3\u662f\u5426\u5728\u7b49\u5f85\u3002\u5982\u679c\u5b83\u4e0d\u5728\u7b49\u5f85\uff0c\u4f46\u8ddd\u79bb\u76ee\u6807\u5956\u676f\u4e0d\u5230\u516b\u4e2a\u50cf\u7d20\uff0c\u6211\u4eec\u8bbe\u7f6e\u4e24\u79d2\u949f\u7684\u9009\u62e9\u65b0\u76ee\u7684\u5730\u7684\u95f9\u949f\uff0c\u7ed3\u675f\u8def\u5f84\u4ee5\u505c\u6b62\u79fb\u52a8\uff0c\u5e76\u58f0\u660e\u6211\u4eec\u73b0\u5728\u5728\u7b49\u5f85\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\uff0c\u4f60\u4f1a\u770b\u5230\u6559\u7ec3\u5728\u4e0d\u8ffd\u9010\u73a9\u5bb6\u65f6\uff0c\u505c\u5728\u5956\u676f\u9644\u8fd1\uff0c\u505c\u987f\u7247\u523b\uff0c\u7136\u540e\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u5956\u676f\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7136\u800c\uff0c\u5982\u679c\u4e24\u4e2a\u6559\u7ec3\u90fd\u53bb\u540c\u4e00\u4e2a\u5956\u676f\uff0c\u5c31\u4f1a\u51fa\u73b0\u95ee\u9898\u3002\u8ba9\u6211\u4eec\u901a\u8fc7\u5728\u68c0\u67e5\u5956\u676f\u7684\u8ddd\u79bb\u540e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n     <span class=\"token function\">mp_potential_step<\/span> <span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9700\u8981\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u662f\u68c0\u67e5\u53d8\u91cf\uff0c\u770b\u6559\u7ec3\u662f\u5426\u9700\u8981\u907f\u8ba9\u3002\u5982\u679c\u9700\u8981\uff0c\u6211\u4eec\u4f7f\u7528<br \/>\n   <code><br \/>\n    mp_potential_step<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5c06\u4f7f\u5b9e\u4f8b\u671d\u7740\u6307\u5b9a\u76ee\u6807\u79fb\u52a8\uff0c\u540c\u65f6\u5c1d\u8bd5\u907f\u5f00\u67d0\u4e9b\u5bf9\u8c61\uff0c\u6216\u8005\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u907f\u5f00\u6240\u6709\u5b9e\u4f8b\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u907f\u8ba9\u53d1\u751f\u7684\u6761\u4ef6\u3002\u5728\u6700\u540e\u7684\u4ee3\u7801\u4e4b\u540e\u7acb\u5373\u63d2\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Coach<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">32<\/span> <span class=\"token operator\">&amp;&amp;<\/span> isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n <span class=\"token punctuation\">{<!-- --><\/span>\n     <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n     isAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n <span class=\"token punctuation\">}<\/span>\n <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Coach<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">32<\/span> <span class=\"token operator\">&amp;&amp;<\/span> isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n <span class=\"token punctuation\">{<!-- --><\/span>\n     <span class=\"token function\">mp_grid_path<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> myPath<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n     <span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>myPath<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n     isAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\uff0c\u6211\u4eec\u68c0\u67e5\u6559\u7ec3\u5b9e\u4f8b\u662f\u5426\u9644\u8fd1\uff0c\u4e14\u5c1a\u672a\u5c1d\u8bd5\u907f\u8ba9\u3002\u5982\u679c\u662f\uff0c\u5219\u6211\u4eec\u8ba9\u6559\u7ec3\u8131\u79bb\u8def\u5f84\u5e76\u5f00\u59cb\u907f\u8ba9\u3002\u63a5\u7740\u662f\u4e00\u4e2a<br \/>\n   <code><br \/>\n    else if<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\uff0c\u68c0\u67e5\u6211\u4eec\u662f\u5426\u4e0e\u53e6\u4e00\u4e2a\u6559\u7ec3\u8db3\u591f\u8fdc\uff0c\u4ee5\u4fbf\u6211\u4eec\u53ef\u4ee5\u907f\u8ba9\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u4e3a\u76ee\u7684\u5730\u8bbe\u7f6e\u4e00\u4e2a\u65b0\u8def\u5f84\uff0c\u5f00\u59cb\u79fb\u52a8\uff0c\u5e76\u7ed3\u675f\u907f\u8ba9\u3002\n  <\/p>\n<ol>\n<li>\n    \u8fd8\u6709\u4e00\u4e2a\u5c0f\u95ee\u9898\u5c1a\u672a\u89e3\u51b3\uff0c\u5982\u679c\u4f60\u8fd0\u884c\u6e38\u620f\u4e00\u6bb5\u65f6\u95f4\u5c31\u4f1a\u53d1\u73b0\u3002\u6709\u65f6\u4e24\u8f86\u6559\u7ec3\u4f1a\u9760\u5f97\u592a\u8fd1\uff0c\u5b83\u4eec\u5c31\u4f1a\u505c\u4e0b\u6765\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u4eec\u8bd5\u56fe\u907f\u5f00\u5f7c\u6b64\uff0c\u4f46\u5b9e\u9645\u4e0a\u5b83\u4eec\u662f\u5728\u63a5\u89e6\u5e76\u4e14\u65e0\u6cd5\u5206\u5f00\u3002\u5728<br \/>\n    <code><br \/>\n     scr_Coach_Step<br \/>\n    <\/code><br \/>\n    \u811a\u672c\u7684\u6700\u540e\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_meeting<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Coach<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    x <span class=\"token operator\">=<\/span> xprevious<span class=\"token punctuation\">;<\/span>\n    y <span class=\"token operator\">=<\/span> yprevious<span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">mp_potential_step<\/span><span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u5c06\u68c0\u67e5\u4e24\u4e2a\u6559\u7ec3\u5b9e\u4f8b\u662f\u5426\u76f8\u4e92\u78b0\u649e\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c06<br \/>\n   <code><br \/>\n    x<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    y<br \/>\n   <\/code><br \/>\n   \u5750\u6807\u8bbe\u7f6e\u4e3a\u7279\u6b8a\u53d8\u91cf<br \/>\n   <code><br \/>\n    xprevious<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    yprevious<br \/>\n   <\/code><br \/>\n   \uff0c\u5b83\u4eec\u4ee3\u8868\u5b9e\u4f8b\u5728\u4e0a\u4e00\u6b65\u4e2d\u7684\u4f4d\u7f6e\u3002\u4e00\u65e6\u5b83\u4eec\u9000\u540e\u4e00\u6b65\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u518d\u6b21\u5c1d\u8bd5\u7ed5\u8fc7\u5b83\u4eec\u3002\n  <\/p>\n<p>\n   \u6559\u7ec3\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u3002\u8981\u68c0\u67e5<br \/>\n   <code><br \/>\n    scr_Coach_Step<br \/>\n   <\/code><br \/>\n   \u7684\u6240\u6709\u4ee3\u7801\u662f\u5426\u90fd\u5199\u6b63\u786e\uff0c\u8fd9\u91cc\u662f\u5b8c\u6574\u7684\u4ee3\u7801\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">45<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">135<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkUp<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">135<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">225<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkLeft<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>direction <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">225<\/span> <span class=\"token operator\">&amp;&amp;<\/span> direction <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">315<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkDown<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> sprite_index <span class=\"token operator\">=<\/span> spr_Coach_WalkRight<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n\ntargetDist <span class=\"token operator\">=<\/span> <span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">150<\/span>  <span class=\"token operator\">&amp;&amp;<\/span> targetDist <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canSee <span class=\"token operator\">=<\/span> <span class=\"token function\">collision_line<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> obj_Wall<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canSee <span class=\"token operator\">==<\/span> noone<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token function\">mp_potential_step<\/span><span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        isChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n    <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canSee <span class=\"token operator\">!=<\/span> noone <span class=\"token operator\">&amp;&amp;<\/span> isChasing <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n        isWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n        isChasing <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>targetDist <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isAttacking <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        swing <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Coach_Attack<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        swing<span class=\"token punctuation\">.<\/span>image_angle <span class=\"token operator\">=<\/span> direction<span class=\"token punctuation\">;<\/span>\n        alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span>\n        isAttacking <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">else<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isWaiting <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n            <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n            isWaiting <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            <span class=\"token function\">mp_potential_step<\/span><span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Coach<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">32<\/span> <span class=\"token operator\">&amp;&amp;<\/span> isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            <span class=\"token function\">path_end<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n            isAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n        <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">distance_to_object<\/span><span class=\"token punctuation\">(<\/span>obj_Coach<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">32<\/span> <span class=\"token operator\">&amp;&amp;<\/span> isAvoiding <span class=\"token operator\">==<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span>\n        <span class=\"token punctuation\">{<!-- --><\/span>\n            <span class=\"token function\">mp_grid_path<\/span><span class=\"token punctuation\">(<\/span>myPathGrid<span class=\"token punctuation\">,<\/span> myPath<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n            <span class=\"token function\">path_start<\/span><span class=\"token punctuation\">(<\/span>myPath<span class=\"token punctuation\">,<\/span> mySpeed<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n            isAvoiding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_meeting<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Coach<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    x <span class=\"token operator\">=<\/span> xprevious<span class=\"token punctuation\">;<\/span>\n    y <span class=\"token operator\">=<\/span> yprevious<span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">mp_potential_step<\/span><span class=\"token punctuation\">(<\/span>target<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> target<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> all<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<h2>\n   <a id=\"_1084\"><br \/>\n   <\/a><br \/>\n   \u4e3a\u6e38\u620f\u6dfb\u52a0\u6700\u540e\u7684\u7ec6\u8282<br \/>\n  <\/h2>\n<p>\n   \u6e38\u620f\u73b0\u5728\u5728\u529f\u80fd\u4e0a\u5df2\u7ecf\u5b8c\u6210\uff0c\u4f46\u8fd8\u6709\u4e00\u4e9b\u5143\u7d20\u9700\u8981\u5b8c\u5584\u3002\u9996\u5148\uff0c\u73a9\u5bb6\u4f1a\u53d7\u5230\u4f24\u5bb3\uff0c\u4f46\u4ece\u4e0d\u4f1a\u6b7b\u4ea1\uff0c\u4e5f\u6ca1\u6709<br \/>\n   <strong><br \/>\n    \u5934\u9876\u663e\u793a<br \/>\n   <\/strong><br \/>\n   \uff08<br \/>\n   <strong><br \/>\n    HUD<br \/>\n   <\/strong><br \/>\n   \uff09\u6765\u663e\u793a\u8fd9\u4e00\u70b9\u3002\u8ba9\u6211\u4eec\u5feb\u901f\u521b\u5efa\u4e00\u4e2a Overlord\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Overlord<br \/>\n     <\/code><br \/>\n     \uff0c\u4e0d\u5e94\u7528\u7cbe\u7075\u5e76\u68c0\u67e5\u6301\u4e45\u6027\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Draw GUI<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u548c\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Overlord_DrawGUI<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">draw_healthbar<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">,<\/span> health<span class=\"token punctuation\">,<\/span> c_black<span class=\"token punctuation\">,<\/span> c_red<span class=\"token punctuation\">,<\/span> c_green<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>health <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    <span class=\"token function\">room_goto<\/span><span class=\"token punctuation\">(<\/span>TitleScreen<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\uff0c\u6211\u4eec\u4f7f\u7528\u4e86\u51fd\u6570<br \/>\n   <code><br \/>\n    draw_healthbar<br \/>\n   <\/code><br \/>\n   \uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5b83\u6709\u5f88\u591a\u53c2\u6570\u3002\u524d\u56db\u4e2a\u662f\u77e9\u5f62\u6761\u7684\u5927\u5c0f\u548c\u4f4d\u7f6e\u3002\u63a5\u4e0b\u6765\u662f\u7528\u4e8e\u63a7\u5236\u6761\u7684\u6ee1\u5ea6\u7684\u53d8\u91cf\uff0c\u5728\u6211\u4eec\u7684\u4f8b\u5b50\u4e2d\u662f\u5168\u5c40\u5065\u5eb7\u53d8\u91cf\u3002\u63a5\u4e0b\u6765\u7684\u4e09\u4e2a\u662f\u80cc\u666f\u989c\u8272\u548c\u6700\u5c0f\/\u6700\u5927\u989c\u8272\u3002\u63a5\u4e0b\u6765\u662f\u6761\u5e94\u8be5\u4e0b\u964d\u7684\u65b9\u5411\uff0c\u96f6\u8868\u793a\u5411\u5de6\u3002\u6700\u540e\u4e24\u4e2a\u5e03\u5c14\u503c\u662f\u7528\u4e8e\u7ed8\u5236\u6211\u4eec\u60f3\u8981\u7684\u80cc\u666f\u548c\u8fb9\u6846\u3002\n  <\/p>\n<p>\n   \u4e4b\u540e\uff0c\u6211\u4eec\u8fdb\u884c\u5065\u5eb7\u68c0\u67e5\uff0c\u5982\u679c\u73a9\u5bb6\u5e94\u8be5\u6b7b\u4e86\uff0c\u6211\u4eec\u79fb\u9664\u73a9\u5bb6\uff0c\u8fd4\u56de\u524d\u7aef\uff0c\u7136\u540e\u79fb\u9664 Overlord \u672c\u8eab\u3002\u79fb\u9664\u4e16\u754c\u4e2d\u7684\u4efb\u4f55\u6301\u4e45\u5b9e\u4f8b\u662f\u5f88\u91cd\u8981\u7684\uff0c\u5426\u5219\u5b83\u4eec\u5c31\u4e0d\u4f1a\u6d88\u5931\uff01\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5c06\u4e00\u4e2a<br \/>\n     <code><br \/>\n      obj_Overlord<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\u653e\u5165<br \/>\n     <code><br \/>\n      C04_R01<br \/>\n     <\/code><br \/>\n     \u4e2d\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7528\u5404\u79cd\u654c\u4eba\u586b\u5145\u623f\u95f4\u3002\u5982\u679c\u6211\u4eec\u4f7f\u7528 Brawl\uff0c\u6211\u4eec\u8981\u4e48\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u9002\u7528\u4e8e\u6211\u4eec\u521b\u5efa\u7684\u8def\u5f84\u7684\u623f\u95f4\uff0c\u8981\u4e48\u66f4\u597d\u7684\u662f\u91cd\u65b0\u7ed8\u5236\u8def\u5f84\u4ee5\u9002\u5e94\u6211\u4eec\u7684\u623f\u95f4\u5e03\u5c40\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u786e\u4fdd<br \/>\n     <code><br \/>\n      Sandbox<br \/>\n     <\/code><br \/>\n     \u623f\u95f4\u88ab\u79fb\u56de\u5230\u8d44\u6e90\u6811\u7684\u5e95\u90e8\u5e76\u8fd0\u884c\u6e38\u620f\u3002\u6211\u4eec\u5e94\u8be5\u5728\u5c4f\u5e55\u9876\u90e8\u770b\u5230\u5065\u5eb7\u6761\uff0c\u5982\u679c\u53d7\u5230\u4f24\u5bb3\uff0c\u5065\u5eb7\u6761\u5e94\u8be5\u4e0b\u964d\u3002\u5982\u679c\u73a9\u5bb6\u53d7\u5230\u4e86\u592a\u591a\u4f24\u5bb3\uff0c\u6e38\u620f\u5c06\u7ed3\u675f\u5e76\u8fd4\u56de\u5230\u524d\u7aef\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<p>\n   \u6240\u6709\u5269\u4e0b\u7684\u5c31\u662f\u521b\u5efa\u5173\u5361\uff0c\u7528\u74f7\u7816\u96c6\u6765\u7ed8\u5236\u4e16\u754c\uff0c\u5e76\u6dfb\u52a0\u4e00\u4e9b\u80cc\u666f\u97f3\u4e50\u3002\u5728\u8fd9\u4e00\u70b9\u4e0a\uff0c\u4f60\u5e94\u8be5\u77e5\u9053\u5982\u4f55\u505a\u4e86\uff0c\u6240\u4ee5\u6211\u4eec\u4f1a\u628a\u5b83\u7559\u7ed9\u4f60\u3002\u6211\u4eec\u5df2\u7ecf\u5728\u201c\u7b2c\u56db\u7ae0\u201d\u6587\u4ef6\u5939\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e9b\u989d\u5916\u7684\u8d44\u6e90\u3002\u5b8c\u6210\u540e\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u622a\u56fe\u7684\u4e1c\u897f\uff1a\n  <\/p>\n<\/p>\n<h2>\n   <a id=\"_1117\"><br \/>\n   <\/a><br \/>\n   \u6458\u8981<br \/>\n  <\/h2>\n<p>\n   \u606d\u559c\u4f60\u5b8c\u6210\u4e86\u4f60\u7684\u7b2c\u4e8c\u4e2a\u6e38\u620f\uff01\u6211\u4eec\u5b66\u4f1a\u4e86\u901a\u8fc7\u5c06\u952e\u76d8\u68c0\u67e5\u548c\u78b0\u649e\u9884\u6d4b\u653e\u5165\u4e00\u4e2a\u811a\u672c\u6765\u7b80\u5316\u73a9\u5bb6\u63a7\u5236\u3002\u6211\u4eec\u6db5\u76d6\u4e86\u5904\u7406\u7cbe\u7075\u52a8\u753b\u7684\u51e0\u79cd\u65b9\u6cd5\uff0c\u4ece\u65cb\u8f6c\u56fe\u50cf\u5230\u8bbe\u7f6e\u5e94\u8be5\u663e\u793a\u54ea\u4e9b\u7cbe\u7075\u3002\u6211\u4eec\u5904\u7406\u4e86\u5168\u5c40\u53d8\u91cf\uff0c\u5e76\u7528\u5b83\u4eec\u6765\u5b9e\u73b0\u4e86\u4e00\u4e2a\u623f\u95f4\u8fc7\u6e21\u7cfb\u7edf\u3002\u6211\u4eec\u6df1\u5165\u8ba8\u8bba\u4e86\u4e00\u4e9b\u65b0\u7684\u5bf9\u8c61\u5c5e\u6027\u548c\u6301\u4e45\u6027\u3002\u7136\u540e\u6211\u4eec\u82b1\u4e86\u4e00\u4e9b\u65f6\u95f4\u5904\u7406\u4eba\u5de5\u667a\u80fd\uff0c\u901a\u8fc7\u63a5\u8fd1\u68c0\u6d4b\u548c\u8def\u5f84\u67e5\u627e\u3002\u6211\u4eec\u751a\u81f3\u53d1\u73b0\u4e86\u5982\u4f55\u4f7f\u4e00\u4e2a\u5bf9\u8c61\u5728\u907f\u5f00\u969c\u788d\u7269\u7684\u540c\u65f6\u81ea\u5df1\u5bfc\u822a\u5230\u4e00\u4e2a\u623f\u95f4\u3002\n  <\/p>\n<p>\n   \u901a\u8fc7\u672c\u7ae0\u4e2d\u6240\u5b66\u7684\u6280\u80fd\uff0c\u4f60\u73b0\u5728\u53ef\u4ee5\u6784\u5efa\u5177\u6709\u591a\u4e2a\u623f\u95f4\u548c\u654c\u4eba\u7684\u6e38\u620f\uff0c\u8fd9\u4e9b\u654c\u4eba\u770b\u8d77\u6765\u4f1a\u601d\u8003\u3002\u73b0\u5728\u8f6e\u5230\u4f60\u901a\u8fc7\u6dfb\u52a0\u66f4\u591a\u72ec\u7279\u7684\u654c\u4eba\u3001\u6253\u5f00\u5956\u676f\u5e76\u751f\u6210\u6218\u5229\u54c1\u6765\u6269\u5c55\u8fd9\u4e2a\u6e38\u620f\u4e86\u3002\u73a9\u5f97\u5f00\u5fc3\uff0c\u63a2\u7d22\u4f60\u65b0\u53d1\u73b0\u7684\u80fd\u529b\uff01\n  <\/p>\n<p>\n   \u5728\u4e0b\u4e00\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4e3a\u5e73\u53f0\u6e38\u620f\u6784\u5efa\u4e00\u573a\u53f2\u8bd7\u822c\u7684 boss \u6218\u3002\u5c06\u4f1a\u6709\u67aa\u652f\u548c\u6fc0\u5149\uff0c\u8fd8\u6709\u5f88\u591a\u4e50\u8da3\u3002\u6211\u4eec\u5c06\u5f00\u59cb\u901a\u8fc7\u521b\u5efa\u53ef\u91cd\u590d\u4f7f\u7528\u7684\u811a\u672c\uff0c\u4ee5\u53ca\u5b66\u4e60\u5982\u4f55\u7cfb\u7edf\u5730\u6784\u5efa\u6211\u4eec\u7684\u4ee3\u7801\u6765\u63d0\u9ad8\u4ee3\u7801\u7684\u6548\u7387\u3002\u6240\u6709\u8fd9\u4e9b\u90fd\u5c06\u5e2e\u52a9\u6211\u4eec\u4f7f\u6e38\u620f\u53d8\u5f97\u66f4\u5feb\u66f4\u5bb9\u6613\uff0c\u6240\u4ee5\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\uff01\n  <\/p>\n<h2>\n   <a id=\"_1126\"><br \/>\n   <\/a><br \/>\n   \u7b2c\u4e94\u7ae0\uff1a\u5e73\u53f0\u4e50\u8da3<br \/>\n  <\/h2>\n<p>\n   \u73b0\u5728\u6211\u4eec\u5bf9\u6784\u5efa\u6e38\u620f\u7684\u57fa\u7840\u6709\u4e86\u5f88\u597d\u7684\u57fa\u7840\uff0c\u6211\u4eec\u51c6\u5907\u521b\u5efa\u66f4\u590d\u6742\u548c\u66f4\u9ad8\u6548\u7684\u9879\u76ee\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u5f00\u53d1\u4e00\u4e2a\u7ecf\u5178\u7684\u5e73\u53f0\u6e38\u620f\uff0c\u5176\u4e2d\u5305\u62ec\u4e00\u573a\u53f2\u8bd7\u822c\u7684 Boss \u6218\u3002\u6211\u4eec\u5c06\u4e13\u6ce8\u4e8e\u6784\u5efa\u7cfb\u7edf\uff0c\u5e76\u5229\u7528\u53ef\u91cd\u590d\u4f7f\u7528\u7684\u811a\u672c\u7b80\u5316\u6211\u4eec\u7684\u4ee3\u7801\u5e76\u8282\u7701\u65f6\u95f4\u3002\u8fd9\u4e5f\u5c06\u51cf\u5c11\u6e38\u620f\u7684\u603b\u4f53\u5927\u5c0f\uff0c\u4f7f\u5176\u4e0b\u8f7d\u901f\u5ea6\u66f4\u5feb\u3002\n  <\/p>\n<p>\n   \u6e38\u620f\u672c\u8eab\u5c06\u5305\u62ec\u4e00\u4e2a\u73a9\u5bb6\u89d2\u8272\uff0c\u53ef\u4ee5\u5728\u4e16\u754c\u4e2d\u5954\u8dd1\uff0c\u8df3\u4e0a\u5e73\u53f0\uff0c\u5e76\u671d\u591a\u4e2a\u65b9\u5411\u5c04\u51fb\u3002\u73a9\u5bb6\u9700\u8981\u51fb\u8d25\u4e00\u4e2a\u5de8\u578b\u673a\u5668 Boss\uff0c\u5b83\u5c06\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u9636\u6bb5\u3002\u5728\u7b2c\u4e00\u9636\u6bb5\uff0c\u73a9\u5bb6\u9700\u8981\u6467\u6bc1\u4e09\u95e8\u66b4\u9732\u4e00\u5c0f\u6bb5\u65f6\u95f4\u7684\u5f3a\u5927\u706b\u70ae\u3002\u7b2c\u4e8c\u9636\u6bb5\u9700\u8981\u6467\u6bc1\u4e00\u4e2a\u5927\u578b\u6fc0\u5149\u70ae\uff0c\u5b83\u4f1a\u4e0a\u4e0b\u79fb\u52a8\uff0c\u4e0d\u65f6\u5730\u53d1\u5c04\u5de8\u5927\u7684\u6fc0\u5149\u675f\u3002\u6700\u540e\u4e00\u4e2a\u9636\u6bb5\u5c06\u6709\u62a4\u76fe\u4fdd\u62a4 Boss \u6838\u5fc3\uff0c\u5076\u5c14\u6253\u5f00\u4ee5\u5141\u8bb8\u73a9\u5bb6\u6d88\u706d Boss \u7684\u6838\u5fc3\u3002\u6240\u6709\u8fd9\u4e9b\u90fd\u5c06\u53d1\u751f\u5728\u73a9\u5bb6\u8bd5\u56fe\u907f\u514d\u88ab\u4e00\u95e8\u4e0d\u53ef\u6467\u6bc1\u7684\u70ae\u5854\u51fb\u4e2d\u7684\u60c5\u51b5\u4e0b\u3002\n  <\/p>\n<h2>\n   <a id=\"_1132\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa\u57fa\u4e8e\u7cfb\u7edf\u7684\u4ee3\u7801\u7ed3\u6784<br \/>\n  <\/h2>\n<p>\n   \u5236\u4f5c\u6e38\u620f\u65f6\uff0c\u901a\u5e38\u4f1a\u5355\u72ec\u6784\u5efa\u6bcf\u4e2a\u7ec4\u4ef6\uff0c\u800c\u4e0d\u8003\u8651\u5b83\u5c06\u5982\u4f55\u5f71\u54cd\u6574\u4e2a\u6e38\u620f\u3002\u5f00\u53d1\u4eba\u5458\u5c06\u6784\u5efa\u4e00\u4e2a\u57fa\u672c\u6846\u67b6\uff0c\u7136\u540e\u5728\u9700\u8981\u65f6\u6dfb\u52a0\u529f\u80fd\uff0c\u901a\u5e38\u4f1a\u4f7f\u7528\u7279\u6b8a\u7684\u6761\u4ef6\u8bed\u53e5\u4f7f\u4ee3\u7801\u80fd\u591f\u6b63\u5e38\u5de5\u4f5c\u800c\u4e0d\u7834\u574f\u6e38\u620f\u3002\u8fd9\u79cd\u65b9\u6cd5\u6700\u7ec8\u4f1a\u5728\u8f6f\u4ef6\u4e2d\u4ea7\u751f\u9519\u8bef\uff0c\u9700\u8981\u66f4\u591a\u7684\u65f6\u95f4\u548c\u7cbe\u529b\u6765\u4fee\u590d\u6bcf\u4e00\u4e2a\u9519\u8bef\u3002\u6e38\u620f\u8d8a\u5927\uff0c\u51fa\u73b0\u95ee\u9898\u7684\u53ef\u80fd\u6027\u5c31\u8d8a\u5927\u3002\u8fd9\u53ef\u80fd\u662f\u4e00\u79cd\u4ee4\u4eba\u6cae\u4e27\u7684\u7ecf\u5386\u3002\n  <\/p>\n<p>\n   \u5c06\u4ee3\u7801\u5206\u89e3\u4e3a\u5355\u72ec\u7684\u7cfb\u7edf\u53ef\u4ee5\u771f\u6b63\u8282\u7701\u65f6\u95f4\u548c\u7cbe\u529b\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u4ee3\u7801\u7684\u5404\u4e2a\u5143\u7d20\u5199\u5165\u811a\u672c\u4e2d\uff0c\u4ee5\u4fbf\u5171\u4eab\uff0c\u800c\u4e0d\u662f\u4e3a\u6bcf\u4e2a\u5bf9\u8c61\u4e00\u904d\u53c8\u4e00\u904d\u5730\u91cd\u5199\u4ee3\u7801\u3002\u5bf9\u4e8e\u8fd9\u4e2a\u6e38\u620f\uff0c\u6211\u4eec\u5c06\u628a\u4e00\u4e9b\u66f4\u57fa\u672c\u7684\u7ec4\u4ef6\uff0c\u6bd4\u5982\u91cd\u529b\u548c\u52a8\u753b\uff0c\u5206\u79bb\u6210\u5b83\u4eec\u81ea\u5df1\u7684\u7cfb\u7edf\u3002\n  <\/p>\n<h3>\n   <a id=\"_1138\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u91cd\u529b<br \/>\n  <\/h3>\n<p>\n   \u6211\u4eec\u8981\u6784\u5efa\u7684\u7b2c\u4e00\u4e2a\u7cfb\u7edf\u662f\u5904\u7406\u91cd\u529b\u7684\u7cfb\u7edf\u3002\u867d\u7136 GameMaker: Studio \u786e\u5b9e\u6709\u4e00\u4e2a\u91cd\u529b\u5c5e\u6027\uff0c\u4f46\u5728\u5e73\u53f0\u6e38\u620f\u4e2d\u5e76\u4e0d\u9700\u8981\u8fd9\u79cd\u590d\u6742\u6027\u3002\u91cd\u529b\u662f\u4e00\u4e2a\u4f5c\u7528\u4e8e\u7269\u4f53\u901f\u5ea6\u7684\u529b\uff0c\u8fd9\u610f\u5473\u7740\u7269\u4f53\u4e0b\u843d\u7684\u65f6\u95f4\u8d8a\u957f\uff0c\u901f\u5ea6\u5c31\u8d8a\u5feb\u3002\u6211\u4eec\u7684\u95ee\u9898\u662f\u5c06\u91cd\u529b\u8bbe\u7f6e\u4e3a\u96f6\u53ea\u610f\u5473\u7740\u5b83\u4e0d\u4f1a\u79fb\u52a8\u5f97\u66f4\u5feb\u3002\u6211\u4eec\u9700\u8981\u7269\u4f53\u5b8c\u5168\u505c\u4e0b\u6765\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u81ea\u5df1\u7684\u91cd\u529b\u7cfb\u7edf\uff0c\u4e0d\u4ec5\u4f7f\u7269\u4f53\u4e0b\u843d\uff0c\u8fd8\u5c06\u5904\u7406\u7740\u9646\u7684\u60c5\u51b5\u3002\u6211\u4eec\u5c06\u521b\u5efa\u81ea\u5df1\u7684\u91cd\u529b\u7cfb\u7edf\uff0c\u4e0d\u4ec5\u4f7f\u7269\u4f53\u4e0b\u843d\uff0c\u8fd8\u5c06\u5904\u7406\u7740\u9646\u7684\u60c5\u51b5\u3002\n  <\/p>\n<p>\n   \u6211\u4eec\u5c06\u9996\u5148\u4ecb\u7ecd<br \/>\n   <strong><br \/>\n    \u5e38\u91cf<br \/>\n   <\/strong><br \/>\n   \u3002\u5e38\u91cf\u5141\u8bb8\u6211\u4eec\u4f7f\u7528\u540d\u79f0\u6765\u8868\u793a\u6c38\u8fdc\u4e0d\u4f1a\u6539\u53d8\u7684\u503c\u3002\u8fd9\u4e0d\u4ec5\u4f7f\u6211\u4eec\u66f4\u5bb9\u6613\u9605\u8bfb\u4ee3\u7801\uff0c\u8fd8\u6709\u52a9\u4e8e\u63d0\u9ad8\u6027\u80fd\uff0c\u4e0e\u53d8\u91cf\u76f8\u6bd4\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u5f00\u59cb\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n     <code><br \/>\n      Chapter_03<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      \u65b0\u9879\u76ee<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6253\u5f00<br \/>\n     <strong><br \/>\n      \u8d44\u6e90<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      \u5b9a\u4e49\u5e38\u91cf<br \/>\n     <\/strong><br \/>\n     \u7f16\u8f91\u5668\u3002\u5728<br \/>\n     <strong><br \/>\n      \u540d\u79f0<br \/>\n     <\/strong><br \/>\n     \u5217\u4e2d\u5199\u5165<br \/>\n     <code><br \/>\n      MAXGRAVITY<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u503c<br \/>\n     <\/strong><br \/>\n     \u4e3a<br \/>\n     <code><br \/>\n      16<br \/>\n     <\/code><br \/>\n     \u3002\u4ee5\u8fd9\u4e2a\u901f\u5ea6\uff0c\u6211\u4eec\u53ef\u4ee5\u786e\u4fdd\u4e0b\u843d\u7684\u7269\u4f53\u4e0d\u4f1a\u79fb\u52a8\u5f97\u592a\u5feb\uff0c\u4ee5\u81f3\u4e8e\u9519\u8fc7\u6e38\u620f\u4e2d\u53e6\u4e00\u4e2a\u7269\u4f53\u7684\u8fb9\u754c\u6846\u3002\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u6bcf\u5f53\u6211\u4eec\u770b\u5230<br \/>\n     <code><br \/>\n      MAXGRAVITY<br \/>\n     <\/code><br \/>\n     \uff0c\u8ba1\u7b97\u673a\u5c06\u770b\u5230<br \/>\n     <code><br \/>\n      16<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<\/ol>\n<h4>\n   <a id=\"_1148\"><br \/>\n   <\/a><br \/>\n   \u6ce8<br \/>\n  <\/h4>\n<p>\n   \u6309\u7167\u60ef\u4f8b\uff0c\u5c06\u6240\u6709\u5e38\u91cf\u90fd\u7528\u5927\u5199\u5b57\u6bcd\u5199\u51fa\uff0c\u5c3d\u7ba1\u5982\u679c\u4e0d\u9075\u5faa\u60ef\u4f8b\uff0c\u4e5f\u4e0d\u4f1a\u51fa\u9519\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gravity<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\u6765\u521b\u5efa\u91cd\u529b\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span> x<span class=\"token punctuation\">,<\/span> y <span class=\"token operator\">+<\/span> vspeed <span class=\"token operator\">+<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    vspeed  <span class=\"token operator\">+=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>    \n    <span class=\"token function\">move_contact_solid<\/span><span class=\"token punctuation\">(<\/span>direction<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\uff0c\u6211\u4eec\u68c0\u67e5\u5b9e\u4f8b\u4e0b\u65b9\u7684\u533a\u57df\u662f\u5426\u6ca1\u6709\u4efb\u4f55\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u4ee5\u5f53\u524d\u901f\u5ea6\u884c\u8fdb\u3002\u5982\u679c\u6e05\u6670\uff0c\u90a3\u4e48\u6211\u4eec\u77e5\u9053\u6211\u4eec\u5728\u7a7a\u4e2d\uff0c\u5e94\u8be5\u65bd\u52a0\u91cd\u529b\u3002\u6211\u4eec\u901a\u8fc7\u6bcf\u4e00\u6b65\u589e\u52a0\u5782\u76f4\u901f\u5ea6\u7684\u5c0f\u91cf\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6709\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\uff0c\u90a3\u4e48\u6211\u4eec\u5373\u5c06\u7740\u5730\uff0c\u6240\u4ee5\u6211\u4eec\u5c06\u5b9e\u4f8b\u79fb\u52a8\u5230\u5bf9\u8c61\u8868\u9762\uff0c\u4ee5\u5b9e\u4f8b\u5f53\u524d\u5411\u4e0a\u884c\u8fdb\u7684\u65b9\u5411\u5230\u6211\u4eec\u7684<br \/>\n   <code><br \/>\n    MAXGRAVITY<br \/>\n   <\/code><br \/>\n   \uff0c\u5373 16 \u50cf\u7d20\u3002\u5728\u90a3\u4e00\u70b9\uff0c\u5b9e\u4f8b\u5728\u5730\u9762\u4e0a\uff0c\u6240\u4ee5\u6211\u4eec\u5c06\u5782\u76f4\u901f\u5ea6\u8bbe\u4e3a\u96f6\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u8ba9\u91cd\u529b\u8d77\u4f5c\u7528\u4e86\uff0c\u4f46\u5982\u679c\u6211\u4eec\u4e0d\u9650\u5236\u5b9e\u4f8b\u4e0b\u843d\u7684\u901f\u5ea6\uff0c\u5b83\u5c06\u4f1a\u52a0\u901f\u5f97\u592a\u5feb\u3002\u5c06\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u5230\u811a\u672c\u7684\u5e95\u90e8\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">vspeed <span class=\"token operator\">=<\/span> <span class=\"token function\">min<\/span><span class=\"token punctuation\">(<\/span>vspeed<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06<br \/>\n   <code><br \/>\n    vspeed<br \/>\n   <\/code><br \/>\n   \u503c\u8bbe\u7f6e\u4e3a\u5f53\u524d<br \/>\n   <code><br \/>\n    vspeed<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    MAXGRAVITY<br \/>\n   <\/code><br \/>\n   \u4e4b\u95f4\u7684\u8f83\u5c0f\u503c\u3002\u5982\u679c\u5b9e\u4f8b\u79fb\u52a8\u5f97\u592a\u5feb\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5c06\u4f7f\u5176\u51cf\u901f\u5230\u5141\u8bb8\u7684\u6700\u5927\u901f\u5ea6\u3002\u73b0\u5728\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u91cd\u529b\u7cfb\u7edf\uff0c\u6e38\u620f\u4e2d\u7684\u6240\u6709\u5bf9\u8c61\u90fd\u53ef\u4ee5\u5229\u7528\u5b83\u3002\n  <\/p>\n<h3>\n   <a id=\"_1174\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa\u52a8\u753b\u7cfb\u7edf<br \/>\n  <\/h3>\n<p>\n   \u6211\u4eec\u5c06\u521b\u5efa\u7684\u4e0b\u4e00\u4e2a\u7cfb\u7edf\u662f\u52a8\u753b\u7cfb\u7edf\uff0c\u5b83\u5c06\u4f5c\u4e3a\u72b6\u6001\u673a\u5b9e\u73b0\u3002\u72b6\u6001\u673a\u5c06\u6240\u6709\u5bf9\u8c61\u7684\u6761\u4ef6\u5206\u89e3\u4e3a\u4e0d\u540c\u7684\u72b6\u6001\u3002\u4e00\u4e2a\u5bf9\u8c61\u5728\u4efb\u4f55\u65f6\u5019\u53ea\u80fd\u5904\u4e8e\u4e00\u4e2a\u9636\u6bb5\uff0c\u56e0\u6b64\u4e0e\u4e4b\u76f8\u5173\u7684\u4ee3\u7801\u53ef\u4ee5\u66f4\u6709\u6548\u5730\u88ab\u5305\u542b\u548c\u7ba1\u7406\u3002\n  <\/p>\n<p>\n   \u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u8fd9\u4e2a\u6982\u5ff5\uff0c\u60f3\u60f3\u4e00\u6247\u95e8\u3002\u4e00\u6247\u95e8\u6709\u51e0\u79cd\u72ec\u7279\u7684\u72b6\u6001\u3002\u53ef\u80fd\u9996\u5148\u60f3\u5230\u7684\u4e24\u79cd\u72b6\u6001\u662f\u95e8\u53ef\u4ee5\u6253\u5f00\u6216\u8005\u5173\u95ed\u3002\u8fd8\u6709\u4e24\u79cd\u5176\u4ed6\u72b6\u6001\uff0c\u5373\u6253\u5f00\u548c\u5173\u95ed\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002\u5982\u679c\u95e8\u6b63\u5728\u6253\u5f00\uff0c\u5b83\u65e2\u4e0d\u662f\u6253\u5f00\u7684\uff0c\u4e5f\u4e0d\u662f\u5173\u95ed\u7684\uff0c\u800c\u662f\u5904\u4e8e\u4e00\u79cd\u72ec\u7279\u7684\u52a8\u4f5c\u72b6\u6001\u3002\u8fd9\u4f7f\u5f97\u72b6\u6001\u673a\u975e\u5e38\u9002\u5408\u52a8\u753b\u3002\u6e38\u620f\u4e2d\u51e0\u4e4e\u6bcf\u4e2a\u53ef\u4ea4\u4e92\u7684\u5bf9\u8c61\u90fd\u53ef\u80fd\u6709\u4e00\u4e9b\u52a8\u753b\u6216\u5229\u7528\u51e0\u4e2a\u4e0d\u540c\u7684\u56fe\u50cf\u3002\n  <\/p>\n<\/p>\n<p>\n   \u7531\u4e8e\u73a9\u5bb6\u89d2\u8272\u901a\u5e38\u662f\u5728\u4e0d\u540c\u52a8\u753b\u65b9\u9762\u6700\u5f3a\u5927\u7684\u5bf9\u8c61\uff0c\u6211\u4eec\u5c06\u9996\u5148\u5206\u89e3\u5176\u72ec\u7279\u7684\u72b6\u6001\u3002\u6211\u4eec\u7684\u73a9\u5bb6\u53ef\u4ee5\u5728\u7a7a\u4e2d\u6216\u5730\u9762\u4e0a\uff0c\u6240\u4ee5\u6211\u4eec\u5e0c\u671b\u786e\u4fdd\u5206\u5f00\u8fd9\u4e9b\u63a7\u5236\u3002\u6211\u4eec\u8fd8\u5e0c\u671b\u73a9\u5bb6\u80fd\u591f\u671d\u591a\u4e2a\u65b9\u5411\u5c04\u51fb\u5e76\u53d7\u5230\u4f24\u5bb3\u3002\u603b\u5171\u6211\u4eec\u5c06\u6709\u516b\u79cd\u4e0d\u540c\u7684\u72b6\u6001\uff1a\n  <\/p>\n<ul>\n<li>\n<p>\n     \u7a7a\u95f2\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7a7a\u95f2\u5411\u4e0a\u7784\u51c6\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7a7a\u95f2\u5411\u4e0b\u7784\u51c6\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5954\u8dd1\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5954\u8dd1\u5411\u4e0a\u7784\u51c6\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5411\u4e0b\u7784\u51c6\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u7a7a\u4e2d\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u4f24\u5bb3\n    <\/p>\n<\/li>\n<\/ul>\n<p>\n   \u8ba9\u6211\u4eec\u9996\u5148\u5c06\u8fd9\u4e9b\u72b6\u6001\u5b9a\u4e49\u4e3a\u5e38\u91cf\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6253\u5f00<br \/>\n     <strong><br \/>\n      \u8d44\u6e90<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      \u5b9a\u4e49\u5e38\u91cf<br \/>\n     <\/strong><br \/>\n     \u7f16\u8f91\u5668\uff0c\u5728<br \/>\n     <strong><br \/>\n      \u540d\u79f0<br \/>\n     <\/strong><br \/>\n     \u5217\u4e2d\u5199\u5165<br \/>\n     <code><br \/>\n      IDLE<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u503c<br \/>\n     <\/strong><br \/>\n     \u4e3a<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u6dfb\u52a0<br \/>\n     <\/strong><br \/>\n     \u6216\u76f4\u63a5\u6309<br \/>\n     <em><br \/>\n      Enter<br \/>\n     <\/em><br \/>\n     \u6dfb\u52a0\u65b0\u884c\uff0c\u5e76\u5199\u5165<br \/>\n     <code><br \/>\n      IDLEUP<br \/>\n     <\/code><br \/>\n     \uff0c\u503c\u4e3a<br \/>\n     <code><br \/>\n      1<br \/>\n     <\/code><br \/>\n     \u3002\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u4e3a\u6240\u6709\u72b6\u6001\u6dfb\u52a0\u9012\u589e\u7684\u6570\u5b57\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\u3002\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      scr_Animation_Control<br \/>\n     <\/code><br \/>\n     \u3002\u6211\u4eec\u5c06\u9996\u5148\u4f7f\u7528<br \/>\n     <code><br \/>\n      switch<br \/>\n     <\/code><br \/>\n     \u8bed\u53e5\u6765\u63a7\u5236\u5404\u79cd\u72b6\u6001\u3002\u6211\u4eec\u8fd8\u5e0c\u671b\u8fd9\u4e2a\u811a\u672c\u662f\u53ef\u91cd\u7528\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e9b\u901a\u7528\u53d8\u91cf\u6765\u4f7f\u4ee3\u7801\u66f4\u901a\u7528\u3002\u8ba9\u6211\u4eec\u9996\u5148\u6dfb\u52a0\u7a7a\u95f2\u72b6\u6001\u7684\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">switch<\/span> <span class=\"token punctuation\">(<\/span>action<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">IDLE<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myIdle<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.1<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a<br \/>\n   <code><br \/>\n    action<br \/>\n   <\/code><br \/>\n   \u7684\u53d8\u91cf\u6765\u5207\u6362\u72b6\u6001\u3002\u5982\u679c\u52a8\u4f5c\u6070\u597d\u662f<br \/>\n   <code><br \/>\n    IDLE<br \/>\n   <\/code><br \/>\n   \uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u6539\u53d8\u7cbe\u7075\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4f7f\u7528\u53e6\u4e00\u4e2a\u53d8\u91cf<br \/>\n   <code><br \/>\n    myIdle<br \/>\n   <\/code><br \/>\n   \uff0c\u6211\u4eec\u5c06\u5728\u6bcf\u4e2a\u5bf9\u8c61\u4e2d\u5b9a\u4e49\u5b83\uff0c\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u91cd\u7528\u8fd9\u4e2a\u811a\u672c\u3002\u6211\u4eec\u8fd8\u8bbe\u7f6e\u4e86\u52a8\u753b\u901f\u7387\uff0c\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u5bf9\u4e0d\u540c\u7684\u52a8\u4f5c\u6709\u4e0d\u540c\u7684\u64ad\u653e\u901f\u5ea6\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u5c06\u6240\u6709\u7684\u60c5\u51b5\u63d2\u5165\u5230\u8fd9\u4e2a\u811a\u672c\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u6539\u53d8\u7cbe\u7075\u548c\u8bbe\u7f6e\u56fe\u50cf\u64ad\u653e\u901f\u5ea6\u7684\u7c7b\u4f3c\u8bbe\u7f6e\u3002\u4ee5\u4e0b\u662f\u5176\u4ed6\u72b6\u6001\u7684\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">IDLEUP<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myIdleUp<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.1<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">IDLEDOWN<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myIdleDown<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.1<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">RUN<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myRun<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">RUNUP<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myRunUp<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">RUNDOWN<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myRunDown<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">INAIR<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myInAir<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token keyword\">case<\/span> <span class=\"token constant\">DAMAGE<\/span> <span class=\"token operator\">:<\/span>\n        sprite_index <span class=\"token operator\">=<\/span> myDamage<span class=\"token punctuation\">;<\/span>\n        image_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">0.5<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span> \n<\/code><\/pre>\n<ol>\n<li>\n    \u6211\u4eec\u5df2\u7ecf\u62e5\u6709\u4e86\u6240\u6709\u9700\u8981\u7684\u72b6\u6001\uff0c\u4f46\u662f\u5982\u4f55\u5904\u7406\u73a9\u5bb6\u9762\u5bf9\u7684\u65b9\u5411\u5462\uff1f\u8fd9\u662f\u4e00\u4e2a\u5e73\u53f0\u6e38\u620f\uff0c\u6240\u4ee5\u4ed6\u4eec\u9700\u8981\u5411\u5de6\u548c\u5411\u53f3\u79fb\u52a8\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u5c06\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u5728 switch \u8bed\u53e5\u7ed3\u675f\u62ec\u53f7\u540e\u7ffb\u8f6c\u56fe\u50cf\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">image_xscale <span class=\"token operator\">=<\/span> facing<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u518d\u6b21\u5229\u7528\u4e00\u4e2a\u53d8\u91cf<br \/>\n   <code><br \/>\n    facing<br \/>\n   <\/code><br \/>\n   \uff0c\u4f7f\u811a\u672c\u66f4\u901a\u7528\u3002\u6211\u4eec\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u4e86\u8fd9\u4e2a\u811a\u672c\uff0c\u52a8\u753b\u7cfb\u7edf\u5df2\u7ecf\u51c6\u5907\u597d\u5b9e\u65bd\u4e86\u3002\n  <\/p>\n<h3>\n   <a id=\"_1261\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u78b0\u649e\u9884\u6d4b\u7cfb\u7edf<br \/>\n  <\/h3>\n<p>\n   \u63a5\u4e0b\u6765\u6211\u4eec\u8981\u6784\u5efa\u7684\u7cfb\u7edf\u662f\u5904\u7406\u4e16\u754c\u78b0\u649e\u3002\u6211\u4eec\u5e0c\u671b\u6446\u8131\u4f7f\u7528 GameMaker: Studio \u7684\u78b0\u649e\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5b83\u9700\u8981\u4e24\u4e2a\u5b9e\u4f8b\u76f8\u4e92\u4ea4\u53c9\u3002\u8fd9\u5bf9\u4e8e\u5b50\u5f39\u4e0e\u73a9\u5bb6\u7684\u78b0\u649e\u6548\u679c\u5f88\u597d\uff0c\u4f46\u5982\u679c\u73a9\u5bb6\u9700\u8981\u9677\u5165\u5730\u9762\u4ee5\u77e5\u9053\u4f55\u65f6\u505c\u6b62\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5c31\u4e0d\u592a\u6709\u6548\u3002\u76f8\u53cd\uff0c\u6211\u4eec\u5e0c\u671b\u5728\u5b9e\u4f8b\u79fb\u52a8\u4e4b\u524d\u9884\u6d4b\u78b0\u649e\u662f\u5426\u4f1a\u53d1\u751f\uff1a\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u5c06\u4ece\u9884\u6d4b\u5b9e\u4f8b\u5de6\u53f3\u4e24\u4fa7\u7684\u5899\u58c1\u78b0\u649e\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Collision_Forecasting<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">-<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canGoLeft <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    canGoLeft <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">+<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canGoRight <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    canGoRight <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u5b9e\u4f8b\u5de6\u4fa7\u7684\u533a\u57df\u662f\u5426\u6ca1\u6709\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u3002\u6211\u4eec\u6b63\u5728\u67e5\u770b\u7684\u8ddd\u79bb\u7531\u53d8\u91cf<br \/>\n   <code><br \/>\n    mySpeed<br \/>\n   <\/code><br \/>\n   \u786e\u5b9a\uff0c\u8fd9\u5c06\u5141\u8bb8\u6b64\u68c0\u67e5\u6839\u636e\u5b9e\u4f8b\u53ef\u80fd\u7684\u79fb\u52a8\u901f\u5ea6\u8fdb\u884c\u8c03\u6574\u3002\u5982\u679c\u533a\u57df\u6e05\u6670\uff0c\u6211\u4eec\u5c06<br \/>\n   <code><br \/>\n    canGoLeft<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    true<br \/>\n   <\/code><br \/>\n   \uff0c\u5426\u5219\u8be5\u533a\u57df\u88ab\u963b\u585e\uff0c\u6211\u4eec\u5c06\u505c\u6b62\u5b9e\u4f8b\u7684\u6c34\u5e73\u901f\u5ea6\u3002\u7136\u540e\u6211\u4eec\u91cd\u590d\u6b64\u68c0\u67e5\u4ee5\u68c0\u67e5\u53f3\u4fa7\u7684\u78b0\u649e\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u68c0\u67e5\u5730\u9762\u78b0\u649e\u3002\u5728\u4e0a\u4e00\u6bb5\u4ee3\u7801\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token operator\">+<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    isOnGround <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    isOnGround <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6b63\u5728\u68c0\u67e5\u5b9e\u4f8b\u6b63\u4e0b\u65b9\u662f\u5426\u6709\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u3002\u5982\u679c\u53d1\u751f\u78b0\u649e\uff0c\u6211\u4eec\u5c06\u53d8\u91cf<br \/>\n   <code><br \/>\n    isOnGround<br \/>\n   <\/code><br \/>\n   \u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    true<br \/>\n   <\/code><br \/>\n   \uff0c\u4ee5\u505c\u6b62\u5782\u76f4\u901f\u5ea6\uff0c\u7136\u540e\u5c06\u5b9e\u4f8b\u7684\u72b6\u6001\u66f4\u6539\u4e3a<br \/>\n   <code><br \/>\n    IDLE<br \/>\n   <\/code><br \/>\n   \u3002\u50cf\u8fd9\u6837\u66f4\u6539\u72b6\u6001\u5c06\u786e\u4fdd\u5b9e\u4f8b\u4ece<br \/>\n   <code><br \/>\n    INAIR<br \/>\n   <\/code><br \/>\n   \u72b6\u6001\u4e2d\u9003\u8131\u3002\n  <\/p>\n<p>\n   \u6b64\u65f6\uff0c\u6211\u4eec\u5df2\u7ecf\u6784\u5efa\u4e86\u5927\u90e8\u5206\u78b0\u649e\u68c0\u6d4b\uff0c\u4f46\u6211\u4eec\u8fd8\u6ca1\u6709\u6db5\u76d6\u6240\u6709\u8fb9\u7f18\u60c5\u51b5\u3002\u6211\u4eec\u76ee\u524d\u53ea\u68c0\u67e5\u5b9e\u4f8b\u7684\u5de6\u4fa7\u3001\u53f3\u4fa7\u548c\u4e0b\u65b9\uff0c\u800c\u4e0d\u662f\u5bf9\u89d2\u7ebf\u3002\u95ee\u9898\u5728\u4e8e\u6240\u6709\u6761\u4ef6\u53ef\u80fd\u90fd\u6210\u7acb\uff0c\u4f46\u5f53\u5b9e\u4f8b\u4ee5\u89d2\u5ea6\u79fb\u52a8\u65f6\uff0c\u53ef\u80fd\u5bfc\u81f4\u5b9e\u4f8b\u88ab\u5361\u5728\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u5185\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e0e\u5176\u4e3a\u6240\u6709\u89d2\u5ea6\u6784\u5efa\u6761\u4ef6\u68c0\u67e5\uff0c\u6211\u4eec\u5c06\u5141\u8bb8\u78b0\u649e\u53d1\u751f\uff0c\u7136\u540e\u5c06\u5176\u5f39\u56de\u5230\u6b63\u786e\u7684\u4f4d\u7f6e\u3002\u5728\u811a\u672c\u7684\u672b\u5c3e\u6dfb\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span> \n    x <span class=\"token operator\">=<\/span> xprevious<span class=\"token punctuation\">;<\/span>\n    y <span class=\"token operator\">=<\/span> yprevious<span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">move_contact_solid<\/span><span class=\"token punctuation\">(<\/span>direction<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6b63\u5728\u68c0\u67e5\u5b9e\u4f8b\u5f53\u524d\u662f\u5426\u4e0e\u53ef\u78b0\u649e\u7684\u5bf9\u8c61\u76f8\u4ea4\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c06 X \u548c Y \u5750\u6807\u8bbe\u7f6e\u4e3a\u4e0a\u4e00\u6b65\u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u5c06\u5176\u6355\u6349\u5230\u79fb\u52a8\u65b9\u5411\u7684\u8868\u9762\u5e76\u5c06\u5782\u76f4\u901f\u5ea6\u8bbe\u7f6e\u4e3a\u96f6\u3002\u8fd9\u5c06\u4ee5\u4e00\u79cd\u73b0\u5b9e\u7684\u65b9\u5f0f\u6e05\u7406\u8fb9\u7f18\u60c5\u51b5\u3002\u6574\u4e2a\u811a\u672c\u5e94\u8be5\u5982\u4e0b\u6240\u793a\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">-<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canGoLeft <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    canGoLeft <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">x <span class=\"token operator\">+<\/span> mySpeed<span class=\"token punctuation\">,<\/span> y<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    canGoRight <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    canGoRight <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token operator\">+<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    isOnGround <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    isOnGround <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">place_free<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span> \n    x <span class=\"token operator\">=<\/span> xprevious<span class=\"token punctuation\">;<\/span>\n    y <span class=\"token operator\">=<\/span> yprevious<span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">move_contact_solid<\/span><span class=\"token punctuation\">(<\/span>direction<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<h3>\n   <a id=\"_1353\"><br \/>\n   <\/a><br \/>\n   \u68c0\u67e5\u952e\u76d8<br \/>\n  <\/h3>\n<p>\n   \u5f53\u6211\u4eec\u5c06\u7cfb\u7edf\u5206\u89e3\u4e3a\u66f4\u53ef\u7528\u7684\u811a\u672c\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5c06\u6240\u6709\u952e\u76d8\u63a7\u4ef6\u653e\u5165\u4e00\u4e2a\u5355\u72ec\u7684\u811a\u672c\u4e2d\u3002\u8fd9\u5c06\u7b80\u5316\u6211\u4eec\u5c06\u6765\u8981\u521b\u5efa\u7684\u4ee3\u7801\uff0c\u5e76\u4e14\u8fd8\u53ef\u4ee5\u8f7b\u677e\u66f4\u6539\u63a7\u4ef6\u6216\u63d0\u4f9b\u66ff\u4ee3\u63a7\u4ef6\u3002\n  <\/p>\n<p>\n   \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n   <code><br \/>\n    scr_Keyboard_Input<br \/>\n   <\/code><br \/>\n   \uff0c\u5e76\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n  <\/p>\n<pre><code class=\"prism language-js\">keyLeft  <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_left<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nkeyRight  <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_right<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nkeyDown  <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_down<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nkeyUp  <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span>vk_up<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nkeyJump <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">ord<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'X'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nkeyShoot <span class=\"token operator\">=<\/span> <span class=\"token function\">keyboard_check<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">ord<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Z'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u7684\u4ee3\u7801\u5c06\u66f4\u5bb9\u6613\u9605\u8bfb\uff0c\u4f8b\u5982\u4f7f\u7528<br \/>\n   <code><br \/>\n    keyJump<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    keyShoot<br \/>\n   <\/code><br \/>\n   \u7b49\u53d8\u91cf\u6765\u8868\u793a\u63a7\u4ef6\uff0c\u800c\u4e0d\u662f\u5b9e\u9645\u7684\u952e\u540d\u3002\u4e3a\u4e86\u5728\u952e\u76d8\u4e0a\u4f7f\u7528\u5b57\u6bcd\u952e\uff0c\u6211\u4eec\u9700\u8981\u76f8\u5173\u7684 ASCII \u7f16\u53f7\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<br \/>\n   <code><br \/>\n    ord<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\uff0c\u800c\u4e0d\u5fc5\u67e5\u627e\u6bcf\u4e2a\u952e\u7684\u7f16\u53f7\uff0c\u5b83\u5c06\u628a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u6b63\u786e\u7684\u6570\u5b57\u3002\n  <\/p>\n<h4>\n   <a id=\"_1370\"><br \/>\n   <\/a><br \/>\n   \u6ce8\u610f<br \/>\n  <\/h4>\n<p>\n   \u5728\u4f7f\u7528<br \/>\n   <code><br \/>\n    ord<br \/>\n   <\/code><br \/>\n   \u51fd\u6570\u65f6\uff0c\u59cb\u7ec8\u4f7f\u7528\u5927\u5199\u5b57\u6bcd\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5f97\u5230\u9519\u8bef\u7684\u6570\u5b57\uff01\n  <\/p>\n<p>\n   \u6211\u4eec\u73b0\u5728\u5df2\u7ecf\u62e5\u6709\u4e86\u8fd9\u4e2a\u6e38\u620f\u6240\u9700\u7684\u6240\u6709\u901a\u7528\u7cfb\u7edf\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u5b9e\u65bd\u5b83\u4eec\u3002\n  <\/p>\n<h2>\n   <a id=\"_1376\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa\u73a9\u5bb6<br \/>\n  <\/h2>\n<p>\n   \u6211\u4eec\u6b63\u5728\u6784\u5efa\u7684\u73a9\u5bb6\u89d2\u8272\u662f\u6211\u4eec\u8fc4\u4eca\u4e3a\u6b62\u521b\u5efa\u7684\u6700\u590d\u6742\u7684\u5bf9\u8c61\u3002\u73a9\u5bb6\u4e0d\u4ec5\u4f1a\u5954\u8dd1\u548c\u8df3\u8dc3\uff0c\u63a7\u5236\u672c\u8eab\u4e5f\u4f1a\u56e0\u73a9\u5bb6\u662f\u5728\u5730\u9762\u4e0a\u8fd8\u662f\u5728\u7a7a\u4e2d\u800c\u7565\u6709\u4e0d\u540c\u3002\u73a9\u5bb6\u9700\u8981\u77e5\u9053\u4ed6\u4eec\u9762\u5411\u7684\u65b9\u5411\uff0c\u8981\u64ad\u653e\u4ec0\u4e48\u52a8\u753b\uff0c\u662f\u5426\u53ef\u4ee5\u5c04\u51fb\u6b66\u5668\u4ee5\u53ca\u5c04\u51fb\u7684\u89d2\u5ea6\u3002\u8ba9\u6211\u4eec\u4ece\u5bfc\u5165\u6240\u6709\u7cbe\u7075\u5f00\u59cb\u6784\u5efa\u8fd9\u4e2a\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Player_Idle<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Player_Idle.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      32<br \/>\n     <\/code><br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      63<br \/>\n     <\/code><br \/>\n     \uff0c\u4f7f\u5176\u5728\u6c34\u5e73\u4e2d\u5fc3\u548c\u5782\u76f4\u5e95\u90e8\u4f11\u606f\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5355\u51fb<br \/>\n     <strong><br \/>\n      \u4fee\u6539\u8499\u7248<br \/>\n     <\/strong><br \/>\n     \u4ee5\u6253\u5f00<br \/>\n     <strong><br \/>\n      \u8499\u7248\u5c5e\u6027<br \/>\n     <\/strong><br \/>\n     \u7f16\u8f91\u5668\uff0c\u5e76\u9009\u62e9<br \/>\n     <strong><br \/>\n      \u8fb9\u754c\u6846<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      \u624b\u52a8<br \/>\n     <\/strong><br \/>\n     \u3002\u5c06\u503c\u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      \u5de6<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      16<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u53f3<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      48<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u4e0a<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      8<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      \u4e0b<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      63<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u91cd\u590d\u6b64\u8fc7\u7a0b\uff0c\u5305\u62ec\u4ee5\u4e0b\u7cbe\u7075\u7684\u76f8\u540c<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      \u8499\u7248\u5c5e\u6027<br \/>\n     <\/strong><br \/>\n     \uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_IdleUp<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_IdleDown<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_Run<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_RunUp<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_RunDown<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_InAir<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<li>\n<p>\n     <code><br \/>\n      spr_Player_Damage<br \/>\n     <\/code>\n    <\/p>\n<\/li>\n<\/ul>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Player_Idle<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521d\u59cb\u5316\u73a9\u5bb6\u89d2\u8272\u6240\u9700\u7684\u6240\u6709\u53d8\u91cf\uff0c\u4ece\u5fc5\u8981\u7684\u52a8\u753b\u53d8\u91cf\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myIdle <span class=\"token operator\">=<\/span> spr_Player_Idle<span class=\"token punctuation\">;<\/span>\nmyIdleUp <span class=\"token operator\">=<\/span> spr_Player_IdleUp<span class=\"token punctuation\">;<\/span>\nmyIdleDown <span class=\"token operator\">=<\/span> spr_Player_IdleDown<span class=\"token punctuation\">;<\/span>\nmyRun <span class=\"token operator\">=<\/span> spr_Player_Run<span class=\"token punctuation\">;<\/span>\nmyRunUp <span class=\"token operator\">=<\/span> spr_Player_RunUp<span class=\"token punctuation\">;<\/span>\nmyRunDown <span class=\"token operator\">=<\/span> spr_Player_RunDown<span class=\"token punctuation\">;<\/span>\nmyInAir <span class=\"token operator\">=<\/span> spr_Player_InAir<span class=\"token punctuation\">;<\/span>\nmyDamage <span class=\"token operator\">=<\/span> spr_Player_Damage<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6b63\u5728\u786e\u5b9a\u8981\u7528\u4e8e\u5404\u79cd\u52a8\u753b\u72b6\u6001\u7684\u7cbe\u7075\u3002\u6211\u4eec\u5728\u8fd9\u91cc\u4f7f\u7528\u7684\u53d8\u91cf\u5fc5\u987b\u4e0e\u6211\u4eec\u5728<br \/>\n   <code><br \/>\n    scr_Animation_Control<br \/>\n   <\/code><br \/>\n   \u4e2d\u58f0\u660e\u7684\u53d8\u91cf\u76f8\u540c\uff0c\u4ee5\u4fbf\u4f7f\u7528\u6211\u4eec\u521b\u5efa\u7684\u52a8\u753b\u7cfb\u7edf\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4e3a\u78b0\u649e\u7cfb\u7edf\u6dfb\u52a0\u53d8\u91cf\uff0c\u4f46\u5728\u8fd9\u4e4b\u524d\uff0c\u6211\u4eec\u5e94\u8be5\u6dfb\u52a0\u4e24\u4e2a\u7528\u4e8e\u9762\u5411\u65b9\u5411\u7684\u5e38\u91cf\u3002\u6253\u5f00<br \/>\n     <strong><br \/>\n      \u8d44\u6e90<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      \u5b9a\u4e49\u5e38\u91cf<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u6dfb\u52a0<br \/>\n     <code><br \/>\n      RIGHT<br \/>\n     <\/code><br \/>\n     \uff0c\u503c\u4e3a<br \/>\n     <code><br \/>\n      1<br \/>\n     <\/code><br \/>\n     \uff0c\u548c<br \/>\n     <code><br \/>\n      LEFT<br \/>\n     <\/code><br \/>\n     \uff0c\u503c\u4e3a<br \/>\n     <code><br \/>\n      -1<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u4e9b\u6570\u5b57\u5c06\u4ee3\u8868\u7ed8\u5236\u56fe\u50cf\u7684\u6bd4\u4f8b\uff0c\u8d1f\u503c\u5c06\u53cd\u8f6c\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      scr_Player_Create<br \/>\n     <\/code><br \/>\n     \u7684\u672b\u5c3e\u6dfb\u52a0\u6211\u4eec\u9700\u8981\u7684\u5176\u4f59\u53d8\u91cf\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">mySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">;<\/span>\nmyAim <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\nfacing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\naction <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\nisDamaged <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\ncanFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u91cc\u6709\u73a9\u5bb6\u901f\u5ea6\u3001\u73a9\u5bb6\u7784\u51c6\u65b9\u5411\u3001\u73a9\u5bb6\u9762\u5411\u65b9\u5411\u548c\u73a9\u5bb6\u72b6\u6001\u7684\u53d8\u91cf\u3002\u6211\u4eec\u8fd8\u6dfb\u52a0\u4e86\u73a9\u5bb6\u662f\u5426\u80fd\u53d7\u5230\u4f24\u5bb3\u6216\u65e0\u654c\uff0c\u4ee5\u53ca\u662f\u5426\u80fd\u5c04\u51fb\u7684\u53d8\u91cf\u3002\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u521d\u59cb\u5316\u4e86\u6240\u6709\u53d8\u91cf\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u5e76\u5e94\u7528<br \/>\n     <code><br \/>\n      scr_Player_Create<br \/>\n     <\/code><br \/>\n     \u811a\u672c\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5df2\u7ecf\u51c6\u5907\u597d\u4e86\u4e00\u4e2a\u78b0\u649e\u9884\u6d4b\u7cfb\u7edf\uff0c\u6211\u4eec\u53ea\u9700\u8981\u9002\u5f53\u5730\u4f7f\u7528\u5b83\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_BeginStep<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u8c03\u7528\u9884\u6d4b\u811a\u672c\u548c\u952e\u76d8\u68c0\u67e5\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Collision_Forecasting<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">scr_Keyboard_Input<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u60a8\u521b\u5efa\u7684\u6bcf\u4e2a\u811a\u672c\u5b9e\u9645\u4e0a\u90fd\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u51fd\u6570\u3002\u5982\u60a8\u5728\u8fd9\u91cc\u6240\u89c1\uff0c\u60a8\u53ea\u9700\u7f16\u5199\u811a\u672c\u7684\u540d\u79f0\u5e76\u5728\u672b\u5c3e\u653e\u7f6e\u62ec\u53f7\uff0c\u5373\u53ef\u8fd0\u884c\u8be5\u4ee3\u7801\u3002\u6211\u4eec\u5c06\u7ecf\u5e38\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u4e2d\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      \u5f00\u59cb\u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528<br \/>\n     <code><br \/>\n      scr_Player_BeginStep<br \/>\n     <\/code><br \/>\n     \u3002<br \/>\n     <strong><br \/>\n      \u5f00\u59cb\u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u662f\u6bcf\u4e2a\u6b65\u9aa4\u4e2d\u8981\u6267\u884c\u7684\u7b2c\u4e00\u4e2a\u4e8b\u4ef6\u3002<br \/>\n     <strong><br \/>\n      \u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u7d27\u968f\u5176\u540e\uff0c<br \/>\n     <strong><br \/>\n      \u7ed3\u675f\u6b65\u9aa4<br \/>\n     <\/strong><br \/>\n     \u662f\u5728\u5b9e\u4f8b\u88ab\u7ed8\u5236\u5728\u5c4f\u5e55\u4e0a\u4e4b\u524d\u7684\u6700\u540e\u4e00\u4e2a\u4e8b\u4ef6\u3002\u8fd9\u4f7f\u6211\u4eec\u80fd\u591f\u66f4\u597d\u5730\u63a7\u5236\u4ee3\u7801\u7684\u8fd0\u884c\u65f6\u95f4\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u63a7\u4ef6\u3002\u6b63\u5982\u6211\u4eec\u4e4b\u524d\u63d0\u5230\u7684\uff0c\u5b9e\u9645\u4e0a\u6709\u4e24\u4e2a\u72ec\u7acb\u7684\u63a7\u5236\u7cfb\u7edf\uff0c\u4e00\u4e2a\u7528\u4e8e\u5728\u5730\u9762\u4e0a\uff0c\u4e00\u4e2a\u7528\u4e8e\u5728\u7a7a\u4e2d\u3002\u6211\u4eec\u5c06\u4ece\u540e\u8005\u5f00\u59cb\uff0c\u56e0\u4e3a\u5b83\u6700\u7b80\u5355\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      scr_Player_AirControls<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Gravity<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyLeft <span class=\"token operator\">&amp;&amp;<\/span> canGoLeft<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">-<\/span>mySpeed<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">-=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    facing <span class=\"token operator\">=<\/span> <span class=\"token constant\">LEFT<\/span><span class=\"token punctuation\">;<\/span>\n    myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyRight <span class=\"token operator\">&amp;&amp;<\/span> canGoRight<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&lt;<\/span> mySpeed<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">+=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    facing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\n    myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u60a8\u5e94\u8be5\u6ce8\u610f\u5230\u7684\u7b2c\u4e00\u4ef6\u4e8b\u662f\uff0c\u6211\u4eec\u4e0d\u518d\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528<br \/>\n   <code><br \/>\n    ==<br \/>\n   <\/code><br \/>\n   \u7b49\u8fd0\u7b97\u7b26\u3002\u8fd9\u4e9b\u53d8\u91cf\u90fd\u662f\u5e03\u5c14\u53d8\u91cf\uff0c\u56e0\u6b64\u5b83\u4eec\u53ea\u80fd\u662f\u771f\u6216\u5047\u3002\u7f16\u5199<br \/>\n   <code><br \/>\n    keyLeft<br \/>\n   <\/code><br \/>\n   \u4e0e\u7f16\u5199<br \/>\n   <code><br \/>\n    keyLeft == true<br \/>\n   <\/code><br \/>\n   \u662f\u76f8\u540c\u7684\uff0c\u4f46\u66f4\u6709\u6548\u7387\u3002\n  <\/p>\n<p>\n   \u73b0\u5728\uff0c\u7531\u4e8e\u73a9\u5bb6\u5728\u7a7a\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u8981\u505a\u7684\u662f\u65bd\u52a0\u91cd\u529b\u3002\u63a5\u4e0b\u6765\u662f\u6c34\u5e73\u79fb\u52a8\u7684\u63a7\u5236\u3002\u6211\u4eec\u68c0\u67e5\u9002\u5f53\u7684\u952e\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u4ee5\u53ca\u73a9\u5bb6\u662f\u5426\u80fd\u591f\u671d\u7740\u8be5\u65b9\u5411\u79fb\u52a8\u3002\u5982\u679c\u8fd9\u4e9b\u6761\u4ef6\u6210\u7acb\uff0c\u6211\u4eec\u5c31\u68c0\u67e5\u6c34\u5e73\u901f\u5ea6\u662f\u5426\u8fbe\u5230\u4e86\u6700\u5927\u901f\u5ea6\u3002\u5982\u679c\u73a9\u5bb6\u80fd\u591f\u589e\u52a0\u901f\u5ea6\uff0c\u6211\u4eec\u5c31\u7a0d\u5fae\u589e\u52a0\u5b83\u3002\u8fd9\u53ef\u4ee5\u9632\u6b62\u73a9\u5bb6\u5728\u7a7a\u4e2d\u592a\u5feb\u5730\u6539\u53d8\u65b9\u5411\u3002\u7136\u540e\u6211\u4eec\u8bbe\u7f6e\u9762\u5411\u548c\u7784\u51c6\u65b9\u5411\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u8f6c\u5411\u66f4\u52a0\u590d\u6742\u7684\u5730\u9762\u63a7\u5236\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c\u547d\u540d\u4e3a<br \/>\n    <code><br \/>\n     scr_Player_GroundControls<br \/>\n    <\/code><br \/>\n    \u3002\u6211\u4eec\u5c06\u4ece\u7f16\u5199\u7a7a\u95f2\u72b6\u6001\u5f00\u59cb\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>keyLeft <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token operator\">!<\/span>keyRight<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&gt;=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">-=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&lt;=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">+=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u5de6\u53f3\u952e\u662f\u5426\u90fd\u6ca1\u6709\u88ab\u6309\u4e0b\u3002\u5982\u679c\u952e\u6ca1\u6709\u88ab\u6309\u4e0b\u800c\u73a9\u5bb6\u6b63\u5728\u79fb\u52a8\uff0c\u6211\u4eec\u5c31\u68c0\u67e5\u4ed6\u4eec\u7684\u79fb\u52a8\u65b9\u5411\uff0c\u7136\u540e\u76f8\u5e94\u5730\u51cf\u5c11\u901f\u5ea6\u3002\u8fd9\u5b9e\u9645\u4e0a\u610f\u5473\u7740\u73a9\u5bb6\u4f1a\u6ed1\u884c\u505c\u4e0b\u6765\u3002\n  <\/p>\n<ol>\n<li>\n    \u73a9\u5bb6\u5df2\u7ecf\u505c\u4e0b\u6765\uff0c\u4f46\u8fd8\u6ca1\u6709\u8fdb\u5165\u7a7a\u95f2\u72b6\u6001\u3002\u4e3a\u4e86\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u6211\u4eec\u9700\u8981\u786e\u5b9a\u73a9\u5bb6\u662f\u5426\u6b63\u5728\u4f7f\u7528\u4e0a\u4e0b\u952e\uff0c\u56e0\u4e3a\u8fd9\u5c06\u5f71\u54cd\u73a9\u5bb6\u7784\u51c6\u7684\u65b9\u5411\u3002\u5728\u6700\u540e\u4e00\u884c\u4ee3\u7801\u4e4b\u540e\uff0c\u4f46\u5728\u6700\u540e\u4e00\u4e2a\u5927\u62ec\u53f7\u5185\u7acb\u5373\u63d2\u5165\u4e0b\u4e00\u4e2a\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyUp<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span> \n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEUP<\/span><span class=\"token punctuation\">;<\/span> \n    myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">45<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyDown<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>   \n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEDOWN<\/span><span class=\"token punctuation\">;<\/span> \n    myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">315<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>facing <span class=\"token operator\">==<\/span> <span class=\"token constant\">LEFT<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>facing <span class=\"token operator\">==<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u4e0a\u952e\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c06\u52a8\u4f5c\u66f4\u6539\u4e3a<br \/>\n   <code><br \/>\n    IDLEUP<br \/>\n   <\/code><br \/>\n   \uff0c\u5e76\u5c06\u7784\u51c6\u8bbe\u7f6e\u4e3a 45 \u5ea6\uff0c\u8fd9\u6837\u73a9\u5bb6\u5c31\u4f1a\u5411\u4e0a\u5c04\u51fb\u3002\u5982\u679c\u4e0d\u662f\uff0c\u6211\u4eec\u68c0\u67e5\u4e0b\u952e\uff0c\u5982\u679c\u5408\u9002\u7684\u8bdd\uff0c\u66f4\u6539\u52a8\u4f5c\u548c\u7784\u51c6\u3002\u6700\u540e\uff0c\u5982\u679c\u8fd9\u4e24\u4e2a\u952e\u90fd\u6ca1\u6709\u88ab\u6309\u4e0b\uff0c\u6211\u4eec\u5c31\u8fdb\u5165\u6807\u51c6\u7684<br \/>\n   <code><br \/>\n    IDLE<br \/>\n   <\/code><br \/>\n   \u72b6\u6001\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u7784\u51c6\uff0c\u6211\u4eec\u9700\u8981\u5148\u770b\u4e00\u4e0b\u73a9\u5bb6\u9762\u5bf9\u7684\u65b9\u5411\u3002\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u73a9\u5bb6\u5c06\u6b63\u786e\u5730\u8fdb\u5165\u7a7a\u95f2\u72b6\u6001\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\u6211\u4eec\u53ef\u4ee5\u6dfb\u52a0\u5de6\u53f3\u63a7\u5236\u3002\u5728\u6700\u540e\u4e00\u4e2a\u5927\u62ec\u53f7\u4e4b\u540e\uff0c\u5199\u4e0b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyLeft <span class=\"token operator\">&amp;&amp;<\/span> canGoLeft<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span>mySpeed<span class=\"token punctuation\">;<\/span>\n    facing <span class=\"token operator\">=<\/span> <span class=\"token constant\">LEFT<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyUp<span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNUP<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">150<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyDown<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNDOWN<\/span><span class=\"token punctuation\">;<\/span>\n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">205<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUN<\/span><span class=\"token punctuation\">;<\/span>\n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5\u5de6\u952e\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u4ee5\u53ca\u73a9\u5bb6\u662f\u5426\u80fd\u591f\u5411\u5de6\u79fb\u52a8\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c31\u8bbe\u7f6e\u6c34\u5e73\u901f\u5ea6\uff0c\u5e76\u5c06\u9762\u5411\u65b9\u5411\u8bbe\u7f6e\u4e3a\u5411\u5de6\u3002\u518d\u6b21\u68c0\u67e5\u5f53\u524d\u662f\u5426\u6309\u4e0b\u4e86\u4e0a\u4e0b\u952e\uff0c\u7136\u540e\u5c06\u52a8\u4f5c\u548c\u7784\u51c6\u8bbe\u7f6e\u4e3a\u9002\u5f53\u7684\u503c\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u4f7f\u7528\u76f8\u5e94\u7684\u503c\u91cd\u590d\u4e0a\u4e00\u6b65\uff0c\u4e3a\u53f3\u952e\u6dfb\u52a0\u76f8\u540c\u7684\u68c0\u67e5\u3002\u73a9\u5bb6\u73b0\u5728\u53ef\u4ee5\u5411\u5de6\u548c\u5411\u53f3\u79fb\u52a8\u4e86\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u73b0\u5728\u6211\u4eec\u53ea\u9700\u8981\u6dfb\u52a0\u8df3\u8dc3\u3002\u5728\u4e0a\u4e00\u4e2a\u4ee3\u7801\u4e4b\u540e\u7acb\u5373\u6dfb\u52a0\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyJump <span class=\"token operator\">&amp;&amp;<\/span> isOnGround<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">INAIR<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5\u8df3\u8dc3\u952e\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u4ee5\u53ca\u73a9\u5bb6\u662f\u5426\u5728\u5730\u9762\u4e0a\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c31\u5c06\u5782\u76f4\u901f\u5ea6\u5411\u4e0a\u8bbe\u7f6e\u4e3a\u6700\u5927\u91cd\u529b\uff0c\u5e76\u5c06\u52a8\u4f5c\u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    INAIR<br \/>\n   <\/code><br \/>\n   \u3002\n  <\/p>\n<ol>\n<li>\n    \u5730\u9762\u63a7\u5236\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\uff1b\u8fd9\u5c31\u662f<br \/>\n    <code><br \/>\n     scr_Player_GroundControls<br \/>\n    <\/code><br \/>\n    \u5e94\u8be5\u770b\u8d77\u6765\u7684\u6837\u5b50\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>keyLeft <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token operator\">!<\/span>keyRight<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&gt;=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">-=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>hspeed <span class=\"token operator\">&lt;=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> hspeed <span class=\"token operator\">+=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyUp<span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEUP<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">45<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyDown<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span>   \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEDOWN<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">315<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>facing <span class=\"token operator\">==<\/span> <span class=\"token constant\">LEFT<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>facing <span class=\"token operator\">==<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyLeft <span class=\"token operator\">&amp;&amp;<\/span> canGoLeft<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    hspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span>mySpeed<span class=\"token punctuation\">;<\/span>\n    facing <span class=\"token operator\">=<\/span> <span class=\"token constant\">LEFT<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyUp<span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNUP<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">150<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyDown<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNDOWN<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">205<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUN<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">180<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyRight <span class=\"token operator\">&amp;&amp;<\/span> canGoRight<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    hspeed <span class=\"token operator\">=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n    facing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyUp<span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNUP<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">30<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyDown<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNDOWN<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">335<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span> \n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUN<\/span><span class=\"token punctuation\">;<\/span> \n        myAim <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyJump <span class=\"token operator\">&amp;&amp;<\/span> isOnGround<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">INAIR<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u7ee7\u7eed\u8fdb\u884c\u73a9\u5bb6\u653b\u51fb\u3002\u9996\u5148\u6211\u4eec\u9700\u8981\u6784\u5efa\u5b50\u5f39\uff0c\u6240\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Bullet<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Bullet.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u53bb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u5c45\u4e2d<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Bullet<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Bullet<br \/>\n     <\/code><br \/>\n     \u5e94\u7528\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u5b50\u5f39\u59cb\u7ec8\u5728\u6240\u6709\u7269\u4f53\u7684\u524d\u9762\uff0c\u6240\u4ee5\u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -2000<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u4e86\u5b50\u5f39\uff0c\u53ef\u4ee5\u7f16\u5199\u653b\u51fb\u4ee3\u7801\u4e86\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Attack<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5199\u4e0b\u4ee5\u4e0b\u5185\u5bb9\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>keyShoot <span class=\"token operator\">&amp;&amp;<\/span> canFire<span class=\"token punctuation\">)<\/span>  \n<span class=\"token punctuation\">{<!-- --><\/span>\n    bullet <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x <span class=\"token operator\">+<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">8<\/span> <span class=\"token operator\">*<\/span> facing<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> y<span class=\"token operator\">-<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> obj_Bullet<span class=\"token punctuation\">)<\/span> \n    bullet<span class=\"token punctuation\">.<\/span>speed <span class=\"token operator\">=<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">;<\/span>\n    bullet<span class=\"token punctuation\">.<\/span>direction <span class=\"token operator\">=<\/span> myAim<span class=\"token punctuation\">;<\/span>\n bullet<span class=\"token punctuation\">.<\/span>image_angle <span class=\"token operator\">=<\/span> myAim<span class=\"token punctuation\">;<\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\n    canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u653b\u51fb\u952e\u662f\u5426\u88ab\u6309\u4e0b\uff0c\u4ee5\u53ca\u73a9\u5bb6\u662f\u5426\u88ab\u5141\u8bb8\u5c04\u51fb\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c31\u4ece\u67aa\u53e3\u521b\u5efa\u4e00\u4e2a\u5b50\u5f39\u5b9e\u4f8b\uff0c\u5e76\u5c06\u552f\u4e00\u7684 ID \u6355\u83b7\u5230\u4e00\u4e2a\u53d8\u91cf\u4e2d\u3002\u8fd9\u4e2a\u5b50\u5f39\u7684\u6c34\u5e73\u4f4d\u7f6e\u4f7f\u7528\u9762\u5411\u53d8\u91cf\u6765\u504f\u79fb\u5b83\u5411\u5de6\u6216\u5411\u53f3\u3002\u6211\u4eec\u8bbe\u7f6e\u5b50\u5f39\u7684\u901f\u5ea6\uff0c\u7136\u540e\u8bbe\u7f6e\u65b9\u5411\u548c\u56fe\u50cf\u65cb\u8f6c\u5230\u73a9\u5bb6\u7784\u51c6\u7684\u4f4d\u7f6e\u3002\u7136\u540e\u6211\u4eec\u8bbe\u7f6e\u4e00\u4e2a\u8b66\u62a5\uff0c\u7528\u4e8e\u91cd\u7f6e<br \/>\n   <code><br \/>\n    canFire<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\uff0c\u6211\u4eec\u5c06\u5176\u66f4\u6539\u4e3a<br \/>\n   <code><br \/>\n    false<br \/>\n   <\/code><br \/>\n   \u3002\n  <\/p>\n<ol>\n<li>\n    \u6b64\u65f6\uff0c\u6211\u4eec\u5df2\u7ecf\u6709\u4e86\u51e0\u4e2a\u7528\u4e8e\u79fb\u52a8\u3001\u653b\u51fb\u548c\u52a8\u753b\u7684\u811a\u672c\uff0c\u4f46\u8fd8\u6ca1\u6709\u5e94\u7528\u5b83\u4eec\u3002\u4e3a\u4e86\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u6211\u4eec\u9700\u8981\u53e6\u4e00\u4e2a\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Player_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u8c03\u7528\u5176\u4ed6\u811a\u672c\u5982\u4e0b\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isOnGround<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">scr_Player_GroundControls<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">scr_Player_AirControls<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token function\">scr_Player_Attack<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u9996\u5148\uff0c\u6211\u4eec\u901a\u8fc7\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5728\u5730\u9762\u4e0a\u6765\u786e\u5b9a\u9700\u8981\u4f7f\u7528\u54ea\u4e9b\u63a7\u5236\u3002\u7136\u540e\u6211\u4eec\u8fd0\u884c\u9002\u5f53\u7684\u63a7\u5236\u811a\u672c\uff0c\u7136\u540e\u662f\u653b\u51fb\u811a\u672c\uff0c\u6700\u540e\u662f\u52a8\u753b\u63a7\u5236\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Step<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      Step<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528<br \/>\n     <code><br \/>\n      scr_Player_Step<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u6d4b\u8bd5\u4e4b\u524d\uff0c\u6211\u4eec\u4ecd\u7136\u9700\u8981\u91cd\u7f6e\u90a3\u4e2a\u8b66\u62a5\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Alarm0<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      canFire<br \/>\n     <\/code><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      true<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Alarm<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Alarm 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528\u6b64\u811a\u672c\u3002\n   <\/li>\n<\/ol>\n<p>\n   \u73a9\u5bb6\u5df2\u7ecf\u51c6\u5907\u597d\u6d4b\u8bd5\u3002\u4e3a\u4e86\u786e\u4fdd\u60a8\u5df2\u7ecf\u6b63\u786e\u8bbe\u7f6e\u4e86\u73a9\u5bb6\uff0c\u5b83\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u7684\u622a\u56fe\uff1a\n  <\/p>\n<\/p>\n<h2>\n   <a id=\"_1649\"><br \/>\n   <\/a><br \/>\n   \u8bbe\u7f6e\u623f\u95f4<br \/>\n  <\/h2>\n<p>\n   \u6211\u4eec\u5df2\u7ecf\u6709\u4e86\u73a9\u5bb6\uff0c\u73b0\u5728\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u4e16\u754c\u6765\u653e\u7f6e\u5b83\u3002\u7531\u4e8e\u6211\u4eec\u6b63\u5728\u5236\u4f5c\u4e00\u4e2a\u5e73\u53f0\u6e38\u620f\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e24\u79cd\u7c7b\u578b\u7684\u6784\u5efa\u5757\uff1a\u5730\u9762\u5bf9\u8c61\u548c\u5e73\u53f0\u5bf9\u8c61\u3002\u5730\u9762\u5c06\u5bf9\u73a9\u5bb6\u4e0d\u53ef\u901a\u8fc7\uff0c\u5e76\u5c06\u7528\u4e8e\u5916\u56f4\u3002\u5e73\u53f0\u5bf9\u8c61\u5c06\u5141\u8bb8\u73a9\u5bb6\u8df3\u8fc7\u5e76\u7740\u9646\u5728\u4e0a\u9762\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Ground<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Ground.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u4e0d\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      OK<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Ground<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Ground<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      Sprite<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u52fe\u9009<br \/>\n     <strong><br \/>\n      Solid<br \/>\n     <\/strong><br \/>\n     \u6846\u3002\u8fd9\u662f\u5fc5\u8981\u7684\uff0c\u56e0\u4e3a\u6211\u4eec\u7684\u78b0\u649e\u4ee3\u7801\u6b63\u5728\u5bfb\u627e\u5b9e\u5fc3\u7269\u4f53\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u6765\u6d4b\u8bd5\u4e00\u4e0b\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u623f\u95f4\uff0c\u5728<br \/>\n     <strong><br \/>\n      Settings<br \/>\n     <\/strong><br \/>\n     \u9009\u9879\u5361\u4e0b\uff0c\u5c06\u540d\u79f0\u66f4\u6539\u4e3a<br \/>\n     <code><br \/>\n      BossArena<br \/>\n     <\/code><br \/>\n     \uff0c\u5c06<br \/>\n     <strong><br \/>\n      Width<br \/>\n     <\/strong><br \/>\n     \u66f4\u6539\u4e3a<br \/>\n     <code><br \/>\n      800<br \/>\n     <\/code><br \/>\n     \u3002\u6211\u4eec\u5e0c\u671b\u6709\u4e00\u4e2a\u8db3\u591f\u5927\u7684\u623f\u95f4\u6765\u8fdb\u884c\u6218\u6597\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u623f\u95f4\u7684\u8fb9\u754c\u5468\u56f4\u6dfb\u52a0<br \/>\n     <code><br \/>\n      obj_Ground<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\u3002\u8fd8\u5728\u623f\u95f4\u7684\u5730\u677f\u9644\u8fd1\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <code><br \/>\n      obj_Player<br \/>\n     <\/code><br \/>\n     \u7684\u5355\u4e2a\u5b9e\u4f8b\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u6b64\u65f6\uff0c\u73a9\u5bb6\u5e94\u8be5\u80fd\u591f\u5728\u623f\u95f4\u5185\u5954\u8dd1\u548c\u8df3\u8dc3\uff0c\u4f46\u4e0d\u80fd\u7a7f\u8fc7\u5899\u58c1\u6216\u5730\u677f\u3002\u60a8\u8fd8\u5e94\u8be5\u80fd\u591f\u4ee5\u5404\u79cd\u65b9\u5411\u5c04\u51fb\u6b66\u5668\u3002\u8fd8\u8981\u6ce8\u610f\uff0c\u52a8\u753b\u7cfb\u7edf\u6b63\u5728\u6309\u9884\u671f\u5de5\u4f5c\uff0c\u7cbe\u7075\u6839\u636e\u73a9\u5bb6\u7684\u52a8\u4f5c\u800c\u6539\u53d8\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u73b0\u5728\u6765\u6784\u5efa\u5e73\u53f0\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Platform<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Platform.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u4e0d\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\u70b9\u51fb<br \/>\n     <strong><br \/>\n      OK<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Platform<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Platform<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      Sprite<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u5e73\u53f0\u53ea\u5728\u73a9\u5bb6\u5728\u5176\u4e0a\u65b9\u65f6\u624d\u662f\u5b9e\u5fc3\u7684\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Platform_EndStep<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>y <span class=\"token operator\">&lt;<\/span> y<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    solid <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    solid <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u73a9\u5bb6\u7684 Y \u5750\u6807\u4e0e\u5b9e\u4f8b\u7684 Y \u5750\u6807\u8fdb\u884c\u6bd4\u8f83\u3002\u5982\u679c\u73a9\u5bb6\u5728\u4e0a\u9762\uff0c\u90a3\u4e48\u5e73\u53f0\u5e94\u8be5\u662f\u5b9e\u5fc3\u7684\u3002\u5426\u5219\u5b83\u4e0d\u662f\u5b9e\u5fc3\u7684\uff0c\u73a9\u5bb6\u53ef\u4ee5\u8df3\u8fc7\u5b83\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      obj_Platform<br \/>\n     <\/code><br \/>\n     \u4e2d\uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Step<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      End Step<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff0c\u5e76\u5e94\u7528\u6b64\u811a\u672c\u3002\u6211\u4eec\u5728\u6b65\u9aa4\u7ed3\u675f\u65f6\u8fd0\u884c\u6b64\u4ee3\u7801\uff0c\u56e0\u4e3a\u6211\u4eec\u53ea\u60f3\u5728\u73a9\u5bb6\u5b9e\u9645\u79fb\u52a8\u4e4b\u540e\uff0c\u4f46\u5728\u5b83\u8fdb\u884c\u53e6\u4e00\u4e2a\u9884\u6d4b\u4e4b\u524d\u8fdb\u884c\u66f4\u6539\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd4\u56de\u5230<br \/>\n     <code><br \/>\n      BossArena<br \/>\n     <\/code><br \/>\n     \u5e76\u6dfb\u52a0\u4e00\u4e9b\u73a9\u5bb6\u53ef\u4ee5\u8df3\u4e0a\u7684\u5e73\u53f0\u3002\u73a9\u5bb6\u53ea\u80fd\u8df3\u5927\u7ea6 128 \u50cf\u7d20\uff0c\u56e0\u6b64\u786e\u4fdd\u5e73\u53f0\u653e\u7f6e\u5f97\u5f53\uff0c\u5982\u4e0b\u6240\u793a\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u73a9\u5bb6\u5e94\u8be5\u80fd\u591f\u8df3\u8fc7\u5e73\u53f0\u5e76\u7ad9\u5728\u4e0a\u9762\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<p>\n   \u6211\u4eec\u5df2\u7ecf\u6210\u529f\u4e3a\u5e73\u53f0\u6e38\u620f\u5f00\u53d1\u4e86\u4e00\u7cfb\u5217\u7cfb\u7edf\u3002\u8fd9\u8981\u6c42\u6211\u4eec\u5c06\u52a8\u753b\u7cfb\u7edf\u548c\u63a7\u5236\u7b49\u5e38\u89c1\u5143\u7d20\u5206\u79bb\u4e3a\u72ec\u7279\u7684\u811a\u672c\u3002\u5982\u679c\u6211\u4eec\u505c\u5728\u8fd9\u91cc\uff0c\u53ef\u80fd\u4f1a\u611f\u89c9\u505a\u4e86\u5f88\u591a\u989d\u5916\u7684\u5de5\u4f5c\u5374\u6beb\u65e0\u610f\u4e49\u3002\u7136\u800c\uff0c\u5f53\u6211\u4eec\u5f00\u59cb\u6784\u5efa Boss \u6218\u65f6\uff0c\u6211\u4eec\u5c06\u5f00\u59cb\u6536\u83b7\u8fd9\u4e00\u52aa\u529b\u7684\u56de\u62a5\u3002\n  <\/p>\n<h2>\n   <a id=\"_Boss__1690\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa Boss \u6218<br \/>\n  <\/h2>\n<p>\n   Boss \u6218\u662f\u6e38\u620f\u4e2d\u6700\u4ee4\u4eba\u6109\u5feb\u7684\u4f53\u9a8c\u4e4b\u4e00\u3002\u6784\u5efa\u4e00\u4e2a\u597d\u7684 Boss \u6218\u603b\u662f\u4e00\u4e2a\u6311\u6218\uff0c\u4f46\u5176\u80cc\u540e\u7684\u7406\u8bba\u5374\u975e\u5e38\u7b80\u5355\u3002\u9075\u5faa\u7684\u7b2c\u4e00\u6761\u89c4\u5219\u662f\uff0cBoss \u5e94\u8be5\u7531\u4e09\u4e2a\u4e0d\u65ad\u589e\u52a0\u96be\u5ea6\u7684\u72ec\u7279\u9636\u6bb5\u7ec4\u6210\u3002\u7b2c\u4e8c\u6761\u89c4\u5219\u662f\uff0cBoss \u5e94\u8be5\u5f3a\u8c03\u7528\u6237\u6700\u65b0\u638c\u63e1\u7684\u6280\u80fd\u3002\u7b2c\u4e09\u6761\u4e5f\u662f\u6700\u540e\u4e00\u6761\u89c4\u5219\u662f\uff0c\u73a9\u5bb6\u5e94\u8be5\u59cb\u7ec8\u6709\u4e8b\u53ef\u505a\u3002\n  <\/p>\n<p>\n   \u6211\u4eec\u7684 boss \u6218\u5c06\u4e0d\u662f\u4e0e\u53e6\u4e00\u4e2a\u89d2\u8272\u5bf9\u6297\uff0c\u800c\u662f\u4e0e\u4e00\u5ea7\u5821\u5792\u5bf9\u6297\u3002\u7b2c\u4e00\u9636\u6bb5\u5c06\u5305\u62ec\u4e09\u95e8\u53ef\u4f38\u7f29\u7684\u5927\u70ae\uff0c\u5b83\u4eec\u5c06\u5728\u623f\u95f4\u5404\u5904\u53d1\u5c04\u70ae\u5f39\u3002\u5fc5\u987b\u6467\u6bc1\u6240\u6709\u4e09\u95e8\u5927\u70ae\u624d\u80fd\u8fdb\u5165\u7b2c\u4e8c\u9636\u6bb5\u3002\u7b2c\u4e8c\u9636\u6bb5\u5c06\u6709\u4e00\u95e8\u5f3a\u5927\u7684\u6fc0\u5149\u70ae\uff0c\u5b83\u5c06\u4e0a\u4e0b\u79fb\u52a8\u5e76\u53d1\u5c04\u5168\u5c4b\u8303\u56f4\u7684\u6fc0\u5149\u675f\uff0c\u73a9\u5bb6\u9700\u8981\u907f\u5f00\u3002\u6700\u540e\u4e00\u9636\u6bb5\u5c06\u662f\u6467\u6bc1\u7531\u4e24\u4e2a\u62a4\u76fe\u4fdd\u62a4\u7684 boss \u6838\u5fc3\u3002\u62a4\u76fe\u53ea\u4f1a\u5728\u77ed\u65f6\u95f4\u5185\u6253\u5f00\u3002\u5728\u6574\u4e2a boss \u6218\u4e2d\uff0c\u5c06\u6709\u4e00\u628a\u4e0d\u53ef\u6467\u6bc1\u7684\u67aa\uff0c\u5b83\u5c06\u5728\u623f\u95f4\u4e2d\u7684\u4efb\u4f55\u4f4d\u7f6e\u5411\u73a9\u5bb6\u5c04\u51fb\u5b50\u5f39\u3002\u968f\u7740\u6bcf\u4e2a\u9636\u6bb5\u7684\u8fdb\u884c\uff0c\u8fd9\u628a\u67aa\u5c06\u5c04\u51fb\u5f97\u66f4\u52a0\u9891\u7e41\uff0c\u4f7f\u6e38\u620f\u66f4\u5177\u6311\u6218\u6027\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5efa\u7acb boss\uff01\n  <\/p>\n<h3>\n   <a id=\"_1696\"><br \/>\n   <\/a><br \/>\n   \u521b\u5efa\u4e0d\u53ef\u6467\u6bc1\u7684\u67aa<br \/>\n  <\/h3>\n<p>\n   \u6211\u4eec\u5c06\u4ece\u4e0d\u53ef\u6467\u6bc1\u7684\u67aa\u5f00\u59cb\uff0c\u56e0\u4e3a\u5b83\u5c06\u662f\u6574\u4e2a\u6218\u6597\u4e2d\u7684\u4e3b\u8981 boss \u653b\u51fb\u3002\u67aa\u9700\u8981\u65cb\u8f6c\uff0c\u4ee5\u4fbf\u59cb\u7ec8\u6307\u5411\u73a9\u5bb6\u3002\u5f53\u5b83\u5c04\u51fa\u67aa\u5b50\u5f39\u65f6\uff0c\u67aa\u5b50\u5f39\u7684\u5b9e\u4f8b\u5c06\u4ece\u67aa\u7684\u5c16\u7aef\u51fa\u73b0\uff0c\u5e76\u671d\u7740\u67aa\u6307\u5411\u7684\u65b9\u5411\u79fb\u52a8\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u8ba9\u6211\u4eec\u4ece\u6784\u5efa\u67aa\u5b50\u5f39\u5f00\u59cb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Gun_Bullet<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Gun_Bullet.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u5c45\u4e2d\uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Gun_Bullet<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Gun_Bullet<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u5b50\u5f39\u59cb\u7ec8\u51fa\u73b0\u5728\u5730\u9762\u548c\u5e73\u53f0\u7684\u4e0a\u65b9\u3002\u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a-<br \/>\n     <code><br \/>\n      2000<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u67aa\u5b50\u5f39\u5c06\u5728\u63a5\u89e6\u65f6\u5bf9\u73a9\u5bb6\u9020\u6210\u4f24\u5bb3\uff0c\u6240\u6709\u5176\u4ed6\u629b\u5c04\u7269\u4e5f\u662f\u5982\u6b64\u3002\u8ba9\u6211\u4eec\u518d\u6b21\u5efa\u7acb\u4e00\u4e2a\u6240\u6709\u6b66\u5668\u90fd\u53ef\u4ee5\u4f7f\u7528\u7684\u5355\u4e00\u7cfb\u7edf\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Damage<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">.<\/span>action <span class=\"token operator\">!=<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    health <span class=\"token operator\">-=<\/span> myDamage<span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>obj_Player<span class=\"token punctuation\">)<\/span> \n    <span class=\"token punctuation\">{<!-- --><\/span> \n        y <span class=\"token operator\">-=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>\n        vspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token constant\">MAXGRAVITY<\/span><span class=\"token punctuation\">;<\/span>\n        hspeed <span class=\"token operator\">=<\/span> <span class=\"token number\">8<\/span> <span class=\"token operator\">*<\/span> <span class=\"token operator\">-<\/span>facing<span class=\"token punctuation\">;<\/span>\n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">;<\/span>\n        isDamaged <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> \n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u4e2a\u811a\u672c\u4e13\u95e8\u7528\u4e8e\u654c\u4eba\u7684\u6b66\u5668\u3002\u6211\u4eec\u9996\u5148\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5df2\u7ecf\u53d7\u4f24\uff0c\u4ee5\u514d\u73a9\u5bb6\u53d7\u5230\u91cd\u590d\u60e9\u7f5a\u3002\u7136\u540e\u6211\u4eec\u901a\u8fc7\u53d8\u91cf<br \/>\n   <code><br \/>\n    myDamage<br \/>\n   <\/code><br \/>\n   \u51cf\u5c11\u5168\u5c40\u751f\u547d\u503c\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u6837\u7684\u53d8\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba9\u4e0d\u540c\u7684\u6b66\u5668\u9020\u6210\u4e0d\u540c\u6570\u91cf\u7684\u4f24\u5bb3\u3002\u7136\u540e\u6211\u4eec\u901a\u8fc7<br \/>\n   <code><br \/>\n    with<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u76f4\u63a5\u5f71\u54cd\u73a9\u5bb6\u3002\u6211\u4eec\u60f3\u8981\u5c06\u73a9\u5bb6\u629b\u5165\u7a7a\u4e2d\uff0c\u4f46\u9996\u5148\u6211\u4eec\u9700\u8981\u5c06\u73a9\u5bb6\u63d0\u9ad8\u4e00\u50cf\u7d20\u4ee5\u786e\u4fdd\u5730\u9762\u78b0\u649e\u4ee3\u7801\u4e0d\u4f1a\u5c06\u5176\u5f39\u56de\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u65bd\u52a0\u5782\u76f4\u901f\u5ea6\u548c\u6c34\u5e73\u901f\u5ea6\uff0c\u4ee5\u76f8\u53cd\u7684\u65b9\u5411\u63a8\u5f00\u3002\u6211\u4eec\u5c06\u73a9\u5bb6\u7684\u52a8\u4f5c\u8bbe\u7f6e\u4e3a<br \/>\n   <code><br \/>\n    DAMAGE<br \/>\n   <\/code><br \/>\n   \u72b6\u6001\uff0c\u5e76\u6307\u793a\u53d1\u751f\u4e86\u4f24\u5bb3\u3002\n  <\/p>\n<ol>\n<li>\n    \u521b\u5efa\u53e6\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gun_Bullet_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u521d\u59cb\u5316<br \/>\n    <code><br \/>\n     myDamage<br \/>\n    <\/code><br \/>\n    \u53d8\u91cf\u3002\u7136\u540e\u5c06\u5176\u5e94\u7528\u4e8e<br \/>\n    <code><br \/>\n     obj_Gun_Bullet<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     \u521b\u5efa<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myDamage <span class=\"token operator\">=<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u78b0\u649e\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gun_Bullet_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5b83\u8c03\u7528\u4f24\u5bb3\u811a\u672c\u5e76\u79fb\u9664\u5b50\u5f39\u3002\u6211\u4eec\u6ca1\u6709\u5c06\u5b9e\u4f8b\u7684\u9500\u6bc1\u653e\u5165<br \/>\n    <code><br \/>\n     scr_Damage<br \/>\n    <\/code><br \/>\n    \u4e2d\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u53ef\u4ee5\u9009\u62e9\u65e0\u6cd5\u88ab\u6467\u6bc1\u7684\u6b66\u5668\u4f7f\u7528\u8fd9\u4e2a\u811a\u672c\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Damage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u5728\u9644\u6709\u6b64\u811a\u672c\u7684<br \/>\n     <code><br \/>\n      obj_Gun_Bullet<br \/>\n     <\/code><br \/>\n     \u4e0a\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u78b0\u649e<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      obj_Player<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u3002\u67aa\u5b50\u5f39\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u79fb\u52a8\u5230\u67aa\u672c\u8eab\u3002\u9996\u5148\u521b\u5efa\u4e24\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Gun_Idle<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Gun_Run<br \/>\n     <\/code><br \/>\n     \u3002\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Gun_Idle.gif<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Gun_Run.gif<br \/>\n     <\/code><br \/>\n     \u5230\u5b83\u4eec\u5173\u8054\u7684\u7cbe\u7075\u4e2d\uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u5220\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u67aa\u7cbe\u7075\u7684\u67aa\u7ba1\u671d\u53f3\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u5728\u5de6\u4fa7\u8bbe\u7f6e\u539f\u70b9\uff0c\u4ee5\u4fbf\u6b63\u786e\u5730\u8fdb\u884c\u65cb\u8f6c\u3002\u5728\u4e24\u4e2a\u7cbe\u7075\u4e0a\u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     :<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     :<br \/>\n     <code><br \/>\n      16<br \/>\n     <\/code><br \/>\n     \uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      \u786e\u5b9a<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Gun<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Gun_Idle<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u786e\u4fdd\u67aa\u59cb\u7ec8\u5728 boss \u7684\u89c6\u89c9\u4e0a\u65b9\uff0c\u6240\u4ee5\u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -1000<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u9700\u8981\u5728\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Gun_Create<br \/>\n     <\/code><br \/>\n     \u4e2d\u521d\u59cb\u5316\u4e00\u4e9b\u53d8\u91cf\uff0c\u7136\u540e\u5c06\u5176\u6dfb\u52a0\u5230<br \/>\n     <code><br \/>\n      obj_Gun<br \/>\n     <\/code><br \/>\n     \u4f5c\u4e3a<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\nfacing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\ntipOfGun <span class=\"token operator\">=<\/span> sprite_width<span class=\"token punctuation\">;<\/span>\ncanFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\ndelay <span class=\"token operator\">=<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> delay<span class=\"token punctuation\">;<\/span>\n\nmyIdle <span class=\"token operator\">=<\/span> spr_Gun_Idle<span class=\"token punctuation\">;<\/span>\nmyRun <span class=\"token operator\">=<\/span> spr_Gun_Run<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u5c06\u5728\u8fd9\u91cc\u4f7f\u7528\u52a8\u753b\u7cfb\u7edf\uff0c\u56e0\u6b64\u9700\u8981\u8bbe\u7f6e\u6240\u9700\u7684\u52a8\u4f5c\u548c\u9762\u5411\u53d8\u91cf\u7684\u503c\u3002\u4ee5\u4e0b\u56db\u4e2a\u53d8\u91cf\u4e0e\u67aa\u7684\u5c04\u51fb\u6709\u5173\u3002\u9996\u5148\u662f<br \/>\n   <code><br \/>\n    tipOfGun<br \/>\n   <\/code><br \/>\n   \uff0c\u7528\u4e8e\u786e\u5b9a\u67aa\u53e3\u7684\u4f4d\u7f6e\uff0c<br \/>\n   <code><br \/>\n    canFire<br \/>\n   <\/code><br \/>\n   \u662f\u89e6\u53d1\u5668\uff0c<br \/>\n   <code><br \/>\n    delay<br \/>\n   <\/code><br \/>\n   \u662f\u5c04\u51fb\u95f4\u9694\u65f6\u95f4\uff0c\u8b66\u62a5\u5c06\u53d1\u5c04\u67aa\u5b50\u5f39\u3002\u6700\u540e\uff0c\u6211\u4eec\u6709\u4e24\u79cd\u52a8\u753b\u72b6\u6001\u9700\u8981\u5e94\u7528\u3002\u9664\u975e\u5bf9\u8c61\u4f7f\u7528\u8be5\u72b6\u6001\uff0c\u5426\u5219\u6211\u4eec\u4e0d\u9700\u8981\u6dfb\u52a0\u6240\u6709\u5176\u4ed6\u53d8\u91cf\uff0c\u5982<br \/>\n   <code><br \/>\n    myDamage<br \/>\n   <\/code><br \/>\n   \u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8ba9\u67aa\u8ddf\u8e2a\u73a9\u5bb6\u5e76\u786e\u5b9a\u4f55\u65f6\u5c04\u51fb\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gun_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5c06\u5176\u653e\u7f6e\u5728<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\u3002\u4ee5\u4e0b\u662f\u6211\u4eec\u9700\u8981\u7684\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>image_index <span class=\"token operator\">&gt;<\/span> image_number<span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canFire<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUN<\/span><span class=\"token punctuation\">;<\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span>\n    canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\nimage_angle <span class=\"token operator\">=<\/span> <span class=\"token function\">point_direction<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">,<\/span> obj_Player<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u8fd0\u884c\u52a8\u753b\u811a\u672c\u3002\u6211\u4eec\u5e0c\u671b\u67aa\u53ea\u64ad\u653e\u4e00\u6b21\u5c04\u51fb\u52a8\u753b\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u5f53\u524d\u663e\u793a\u7684\u56fe\u50cf\u4e0e\u7cbe\u7075\u7684\u6700\u540e\u4e00\u4e2a\u56fe\u50cf\u8fdb\u884c\u6bd4\u8f83\u3002\u4f7f\u7528<br \/>\n   <code><br \/>\n    image_number<br \/>\n   <\/code><br \/>\n   \u53ef\u4ee5\u5f97\u5230\u5e27\u6570\uff0c\u4f46\u7531\u4e8e\u52a8\u753b\u5e27\u4ece\u96f6\u5f00\u59cb\uff0c\u6211\u4eec\u9700\u8981\u51cf\u53bb\u4e00\u3002\u5982\u679c\u662f\u6700\u540e\u4e00\u5e27\uff0c\u90a3\u4e48\u67aa\u5c31\u8fdb\u5165\u201c\u7a7a\u95f2\u201d\u72b6\u6001\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u68c0\u67e5\u67aa\u662f\u5426\u8981\u5c04\u51fb\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u6539\u53d8\u72b6\u6001\u4ee5\u64ad\u653e\u5c04\u51fb\u52a8\u753b\uff0c\u8bbe\u7f6e\u7b2c\u4e8c\u4e2a\u8b66\u62a5\u4e3a 5 \u5e27\uff0c\u7136\u540e\u5173\u95ed<br \/>\n   <code><br \/>\n    canFire<br \/>\n   <\/code><br \/>\n   \u3002\u6700\u540e\uff0c\u6211\u4eec\u901a\u8fc7\u6839\u636e\u67aa\u548c\u73a9\u5bb6\u4e4b\u95f4\u7684\u89d2\u5ea6\u65cb\u8f6c\u7cbe\u7075\u6765\u8ddf\u8e2a\u73a9\u5bb6\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u5728\u8fd9\u4e2a\u5bf9\u8c61\u4e0a\u4f7f\u7528\u4e86\u4e24\u4e2a\u8b66\u62a5\u3002\u7b2c\u4e00\u4e2a\u8b66\u62a5\u5f00\u59cb\u5c04\u51fb\u52a8\u753b\uff0c\u7b2c\u4e8c\u4e2a\u521b\u5efa\u67aa\u5b50\u5f39\u3002\u8ba9\u6211\u4eec\u4ece\u7b2c\u4e00\u4e2a\u8b66\u62a5\u5f00\u59cb\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gun_Alarm0<br \/>\n    <\/code><br \/>\n    \uff0c\u7528\u4e8e<br \/>\n    <strong><br \/>\n     \u8b66\u62a5<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u8b66\u62a5 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u7b2c\u4e8c\u4e2a\u8b66\u62a5\u5305\u542b\u4e86\u5f00\u67aa\u7684\u4ee3\u7801\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_Gun_Alarm1<br \/>\n    <\/code><br \/>\n    \uff0c\u5c06\u5176\u6dfb\u52a0\u4e3a<br \/>\n    <strong><br \/>\n     \u8b66\u62a5<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u8b66\u62a5 1<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myX <span class=\"token operator\">=<\/span> x <span class=\"token operator\">+<\/span> <span class=\"token function\">lengthdir_x<\/span><span class=\"token punctuation\">(<\/span>tipOfGun<span class=\"token punctuation\">,<\/span> image_angle<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nmyY <span class=\"token operator\">=<\/span> y <span class=\"token operator\">+<\/span> <span class=\"token function\">lengthdir_y<\/span><span class=\"token punctuation\">(<\/span>tipOfGun<span class=\"token punctuation\">,<\/span> image_angle<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> \nbullet <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>myX<span class=\"token punctuation\">,<\/span> myY<span class=\"token punctuation\">,<\/span> obj_Gun_Bullet<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nbullet<span class=\"token punctuation\">.<\/span>speed <span class=\"token operator\">=<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">;<\/span>\nbullet<span class=\"token punctuation\">.<\/span>direction <span class=\"token operator\">=<\/span> image_angle<span class=\"token punctuation\">;<\/span>\nalarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> delay<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u7531\u4e8e\u6211\u4eec\u9700\u8981\u5b50\u5f39\u79bb\u5f00\u67aa\u53e3\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e9b\u4e09\u89d2\u51fd\u6570\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u6b63\u5f26\u548c\u4f59\u5f26\u6765\u8ba1\u7b97 X \u548c Y \u503c\uff0c\u4f46\u6709\u4e00\u4e2a\u66f4\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<br \/>\n   <code><br \/>\n    lengthdir_x<br \/>\n   <\/code><br \/>\n   \u548c<br \/>\n   <code><br \/>\n    lengthdir_y<br \/>\n   <\/code><br \/>\n   \u6765\u4e3a\u6211\u4eec\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u3002\u5b83\u6240\u9700\u8981\u7684\u53ea\u662f\u5f84\u5411\u8ddd\u79bb\u548c\u89d2\u5ea6\uff0c\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u6dfb\u52a0\u5230\u67aa\u7684\u672c\u5730\u5750\u6807\u4e2d\u3002\u4e00\u65e6\u6211\u4eec\u6709\u4e86\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728\u6b63\u786e\u7684\u4f4d\u7f6e\u521b\u5efa\u5b50\u5f39\uff0c\u8bbe\u7f6e\u5176\u901f\u5ea6\u548c\u65b9\u5411\u3002\u6700\u540e\uff0c\u6211\u4eec\u91cd\u7f6e\u7b2c\u4e00\u4e2a\u8b66\u62a5\uff0c\u4ee5\u4fbf\u67aa\u518d\u6b21\u5f00\u706b\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u51c6\u5907\u6d4b\u8bd5\u67aa\u3002\u6253\u5f00 BossArena \u5e76\u5728\u623f\u95f4\u7684\u6700\u53f3\u4fa7\u653e\u7f6e\u4e00\u628a\u67aa\u7684\u5b9e\u4f8b\u3002\u4e00\u65e6\u6d4b\u8bd5\u5b8c\u6210\uff0c\u6211\u4eec\u5c06\u4ece\u623f\u95f4\u4e2d\u79fb\u9664\u67aa\uff0c\u56e0\u6b64\u6b64\u65f6\u786e\u5207\u7684\u653e\u7f6e\u4f4d\u7f6e\u5e76\u4e0d\u91cd\u8981\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u67aa\u5e94\u8be5\u4f1a\u8ddf\u968f\u73a9\u5bb6\u5728\u623f\u95f4\u4e2d\u7684\u4efb\u4f55\u4f4d\u7f6e\uff0c\u5e76\u4e14\u6bcf\u4e09\u79d2\u53d1\u5c04\u4e00\u6b21\u67aa\u5b50\u5f39\u3002\u5982\u679c\u73a9\u5bb6\u88ab\u67aa\u5b50\u5f39\u51fb\u4e2d\uff0c\u4ed6\u4eec\u5c06\u88ab\u51fb\u98de\u5e76\u53d7\u5230\u4f24\u5bb3\u52a8\u753b\u7684\u5f71\u54cd\uff0c\u5c31\u50cf\u5728\u4e4b\u524d\u7684\u622a\u56fe\u4e2d\u770b\u5230\u7684\u90a3\u6837\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u7136\u800c\uff0c\u73a9\u5bb6\u7684\u4f24\u5bb3\u72b6\u6001\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff1b\u73a9\u5bb6\u4ecd\u7136\u53ef\u4ee5\u79fb\u52a8\u548c\u5c04\u51fb\u3002\u8fd9\u5bf9\u4e8e\u88ab\u5c04\u51fb\u5e76\u4e0d\u662f\u591a\u5927\u7684\u5a01\u6151\u529b\uff0c\u56e0\u6b64\u8ba9\u6211\u4eec\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Player_Damage<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isOnGround<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    isDamaged <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">scr_Gravity<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5728\u5730\u9762\u4e0a\uff0c\u56e0\u4e3a\u8fd9\u5c06\u505c\u7528\u4f24\u5bb3\u72b6\u6001\u3002\u5982\u679c\u73a9\u5bb6\u5728\u7a7a\u4e2d\uff0c\u6211\u4eec\u65bd\u52a0\u91cd\u529b\uff0c\u5c31\u8fd9\u6837\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u9700\u8981\u8c03\u7528\u8fd9\u4e2a\u811a\u672c\u3002\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Player_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u6dfb\u52a0\u4e00\u4e2a\u6761\u4ef6\u8bed\u53e5\uff0c\u7528\u4e8e\u5224\u65ad\u73a9\u5bb6\u662f\u5426\u53d7\u4f24\u3002\u4ee5\u4e0b\u662f\u5305\u542b\u65b0\u4ee3\u7801\u7684\u6574\u4e2a\u811a\u672c\uff0c\u65b0\u4ee3\u7801\u7528\u7c97\u4f53\u6807\u51fa\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isDamaged<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n <span class=\"token function\">scr_Player_Damage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isOnGround<span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token function\">scr_Player_GroundControls<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<!-- --><\/span>\n        <span class=\"token function\">scr_Player_AirControls<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n    <span class=\"token function\">scr_Player_Attack<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> \n<span class=\"token punctuation\">}<\/span>\n<span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5\u73a9\u5bb6\u662f\u5426\u5904\u4e8e\u4f24\u5bb3\u6a21\u5f0f\uff0c\u5982\u679c\u662f\uff0c\u6211\u4eec\u8fd0\u884c\u4f24\u5bb3\u811a\u672c\u3002\u5426\u5219\uff0c\u6211\u4eec\u50cf\u5e73\u5e38\u4e00\u6837\u4f7f\u7528\u6240\u6709\u63a7\u5236\u7cfb\u7edf\u5728<br \/>\n   <code><br \/>\n    else<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u4e2d\u3002\u65e0\u8bba\u662f\u5426\u53d7\u4f24\uff0c\u52a8\u753b\u811a\u672c\u90fd\u4f1a\u88ab\u8c03\u7528\u3002\n  <\/p>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u73b0\u5728\u5f53\u73a9\u5bb6\u88ab\u51fb\u4e2d\u65f6\uff0c\u51b2\u51fb\u6548\u679c\u975e\u5e38\u660e\u663e\u3002\n   <\/li>\n<\/ol>\n<h3>\n   <a id=\"_1844\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa\u7b2c\u4e00\u9636\u6bb5\uff1a\u5927\u70ae<br \/>\n  <\/h3>\n<p>\n   \u7b2c\u4e00\u9636\u6bb5\u7684\u6b66\u5668\u662f\u4e00\u4e2a\u5927\u70ae\uff0c\u5b83\u4f1a\u9690\u85cf\u81ea\u5df1\u4ee5\u4fdd\u62a4\u81ea\u5df1\uff0c\u53ea\u6709\u5728\u5c04\u51fb\u65f6\u624d\u4f1a\u66b4\u9732\u51fa\u6765\u3002\u6211\u4eec\u5c06\u6709\u4e09\u95e8\u5927\u70ae\u5806\u53e0\u5728\u4e00\u8d77\uff0c\u4f7f\u73a9\u5bb6\u5fc5\u987b\u8df3\u4e0a\u5e73\u53f0\u3002\u8981\u6467\u6bc1\u5927\u70ae\uff0c\u73a9\u5bb6\u9700\u8981\u5728\u5927\u70ae\u66b4\u9732\u65f6\u5c04\u51fb\u6bcf\u95e8\u5927\u70ae\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u4ece Cannonball \u5f00\u59cb\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075<br \/>\n     <code><br \/>\n      spr_Cannonball<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Cannonball.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      Origin<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     :<br \/>\n     <code><br \/>\n      12<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     :<br \/>\n     <code><br \/>\n      32<br \/>\n     <\/code><br \/>\n     \uff0c\u7136\u540e\u70b9\u51fb<br \/>\n     <strong><br \/>\n      OK<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61<br \/>\n     <code><br \/>\n      obj_Cannonball<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Cannonball<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      Sprite<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      Depth<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -900<br \/>\n     <\/code><br \/>\n     \uff0c\u8fd9\u6837\u5b83\u5c06\u51fa\u73b0\u5728\u5927\u591a\u6570\u5bf9\u8c61\u7684\u524d\u9762\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u4e3a\u4e86\u4f7f\u7528\u4f24\u5bb3\u7cfb\u7edf\uff0c\u6211\u4eec\u9700\u8981\u5728<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u8bbe\u7f6e\u6b63\u786e\u7684\u53d8\u91cf\uff0c\u4f7f\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Cannonball_Create<br \/>\n     <\/code><br \/>\n     \uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myDamage <span class=\"token operator\">=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\nhspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">24<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u4e2a\u6b66\u5668\u5f88\u5f3a\u5927\uff0c\u4f1a\u9020\u6210 10 \u70b9\u4f24\u5bb3\u3002\u6211\u4eec\u8fd8\u8bbe\u7f6e\u4e86\u6c34\u5e73\u901f\u5ea6\uff0c\u4ee5\u4fbf\u5b83\u53ef\u4ee5\u5feb\u901f\u7a7f\u8fc7\u623f\u95f4\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5982\u679c Cannonball \u63a5\u89e6\u5230\u73a9\u5bb6\uff0c\u6211\u4eec\u4e0d\u4f1a\u6467\u6bc1\u5b83\uff0c\u6240\u4ee5\u6211\u4eec\u53ea\u9700\u8981\u5728<br \/>\n     <strong><br \/>\n      Collision<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      obj_Player<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u5e94\u7528<br \/>\n     <code><br \/>\n      scr_Damage<br \/>\n     <\/code><br \/>\n     \u3002Cannonball \u73b0\u5728\u5df2\u7ecf\u51c6\u5907\u597d\u88ab\u5c04\u51fb\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5927\u70ae\u5c06\u9700\u8981\u4e94\u4e2a\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Cannon_IdleDown<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <code><br \/>\n      spr_Cannon_IdleUp<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <code><br \/>\n      spr_Cannon_RunDown<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <code><br \/>\n      spr_Cannon_RunUp<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Cannon_Damage<br \/>\n     <\/code><br \/>\n     \u3002\u4ece<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/<br \/>\n     <\/code><br \/>\n     \u6587\u4ef6\u5939\u52a0\u8f7d\u76f8\u5173\u6587\u4ef6\uff0c\u4e0d\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61<br \/>\n     <code><br \/>\n      obj_Cannon<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_Cannon_IdleDown<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      Sprite<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      Depth<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -1000<br \/>\n     <\/code><br \/>\n     \uff0c\u8fd9\u6837\u5927\u70ae\u5c06\u4f4d\u4e8e\u5176\u4ed6 Boss \u90e8\u4ef6\u7684\u524d\u9762\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u50cf\u5f80\u5e38\u4e00\u6837\uff0c\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Cannon_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5728<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u521d\u59cb\u5316\u6240\u6709\u53d8\u91cf\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myHealth <span class=\"token operator\">=<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">;<\/span>\naction <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEDOWN<\/span><span class=\"token punctuation\">;<\/span>\nfacing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\ncanFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n\nmyIdleUp <span class=\"token operator\">=<\/span> spr_Cannon_IdleUp<span class=\"token punctuation\">;<\/span>\nmyIdleDown <span class=\"token operator\">=<\/span> spr_Cannon_IdleDown<span class=\"token punctuation\">;<\/span>\nmyRunUp <span class=\"token operator\">=<\/span> spr_Cannon_RunUp<span class=\"token punctuation\">;<\/span>\nmyRunDown <span class=\"token operator\">=<\/span> spr_Cannon_RunDown<span class=\"token punctuation\">;<\/span>\nmyDamage <span class=\"token operator\">=<\/span> spr_Cannon_Damage<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5927\u70ae\u5728\u88ab\u6467\u6bc1\u4e4b\u524d\u9700\u8981\u627f\u53d7\u591a\u6b21\u6253\u51fb\uff0c\u6240\u4ee5\u6211\u4eec\u6709\u4e00\u4e2a<br \/>\n   <code><br \/>\n    myHealth<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u6765\u8ddf\u8e2a\u4f24\u5bb3\u3002\u7136\u540e\u901a\u8fc7\u9762\u5411\u53f3\u4fa7\u6765\u8bbe\u7f6e\u52a8\u4f5c\u72b6\u6001\uff0c\u56e0\u4e3a\u6211\u4eec\u4e0d\u4f1a\u7ffb\u8f6c\u7cbe\u7075\uff0c\u5e76\u5efa\u7acb\u4e00\u4e2a\u5c04\u51fb\u53d8\u91cf\u3002\u7136\u540e\u6211\u4eec\u6709\u4e86\u5927\u70ae\u5de5\u4f5c\u6240\u9700\u7684\u6240\u6709\u52a8\u753b\u72b6\u6001\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Cannon_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5728<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\u5b9e\u73b0\u5207\u6362\u72b6\u6001\u548c\u53d1\u5c04 Cannonballs \u7684\u529f\u80fd\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>image_index <span class=\"token operator\">&gt;<\/span> image_number<span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>action <span class=\"token operator\">==<\/span> <span class=\"token constant\">RUNUP<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEUP<\/span><span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">}<\/span>\n    <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>action <span class=\"token operator\">==<\/span> <span class=\"token constant\">RUNDOWN<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLEDOWN<\/span><span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">}<\/span> \n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canFire<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNUP<\/span><span class=\"token punctuation\">;<\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span>\n    canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>myHealth <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u4e0e\u67aa\u7c7b\u4f3c\uff0c\u6211\u4eec\u9996\u5148\u8c03\u7528\u52a8\u753b\u7cfb\u7edf\u811a\u672c\u3002\u7136\u540e\u68c0\u67e5\u5927\u70ae\u662f\u5426\u5728\u52a8\u753b\u7684\u6700\u540e\u4e00\u5e27\u3002\u8fd9\u91cc\u6709\u4e24\u79cd\u4e0d\u540c\u7684\u7a7a\u95f2\u72b6\u6001\uff0c\u53d6\u51b3\u4e8e\u5927\u70ae\u662f\u5426\u66b4\u9732\u51fa\u6765\u3002\u6211\u4eec\u68c0\u67e5\u6211\u4eec\u5904\u4e8e\u54ea\u79cd\u72b6\u6001\uff0c\u5e76\u8bbe\u7f6e\u9002\u5f53\u7684\u7a7a\u95f2\u72b6\u6001\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u68c0\u67e5\u5927\u70ae\u662f\u5426\u5e94\u8be5\u5c04\u51fb\uff0c\u5982\u679c\u5e94\u8be5\uff0c\u6211\u4eec\u5c31\u4f1a\u66b4\u9732\u5927\u70ae\uff0c\u5e76\u8bbe\u7f6e\u4e00\u4e2a\u8b66\u62a5\uff0c\u5728\u4e24\u79d2\u540e\u521b\u5efa Cannonball\u3002\u6700\u540e\uff0c\u6211\u4eec\u8fdb\u884c\u5065\u5eb7\u68c0\u67e5\uff0c\u5982\u679c\u5927\u70ae\u6ca1\u6709\u751f\u547d\u529b\u4e86\uff0c\u5b83\u5c31\u4f1a\u4ece\u6e38\u620f\u4e2d\u79fb\u9664\u3002\n  <\/p>\n<ol>\n<li>\n    \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Cannon_Alarm0<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230<br \/>\n    <strong><br \/>\n     Alarm<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Alarm 0<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_Cannonball<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\naction <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUNDOWN<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\u6211\u4eec\u53ea\u662f\u521b\u5efa\u4e00\u4e2a Cannonball\uff0c\u7136\u540e\u8bbe\u7f6e\u52a8\u753b\u4ee5\u6536\u56de\u5927\u70ae\u3002\n  <\/p>\n<ol>\n<li>\n    \u5927\u70ae\u7684\u6700\u540e\u4e00\u4ef6\u4e8b\u662f\u627f\u53d7\u4f24\u5bb3\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Cannon_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u5e94\u7528\u5230<br \/>\n    <strong><br \/>\n     Collision<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     obj_Bullet<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>action <span class=\"token operator\">==<\/span> <span class=\"token constant\">IDLEUP<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    myHealth <span class=\"token operator\">-=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>other<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span><span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u786e\u4fdd\u53ea\u6709\u5728\u5927\u70ae\u66b4\u9732\u65f6\u624d\u4f1a\u5e94\u7528\u4f24\u5bb3\u3002\u5982\u679c\u662f\u7684\u8bdd\uff0c\u6211\u4eec\u5c31\u4f1a\u51cf\u5c11\u5b83\u7684 10 \u70b9\u751f\u547d\u503c\uff0c\u5207\u6362\u5230\u4f24\u5bb3\u52a8\u753b\uff0c\u5e76\u79fb\u9664\u5b50\u5f39\u3002\u5927\u70ae\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728\u6211\u4eec\u5c1d\u8bd5\u6d4b\u8bd5\u5927\u70ae\u4e4b\u524d\uff0c\u6211\u4eec\u5c06\u5f00\u59cb\u6784\u5efa Boss\u3002\u5927\u70ae\u4e0d\u80fd\u81ea\u884c\u8fd0\u884c\uff0c\u800c\u662f\u7531 Boss \u63a7\u5236\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<br \/>\n     <code><br \/>\n      obj_Boss<br \/>\n     <\/code><br \/>\n     \u7684\u65b0\u5bf9\u8c61\u3002\u6ca1\u6709\u7cbe\u7075\u53ef\u5206\u914d\uff0c\u56e0\u4e3a Boss \u7531\u5176\u4ed6\u5bf9\u8c61\u7ec4\u6210\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Boss_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5728<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u521d\u59cb\u5316\u53d8\u91cf\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isPhase_01 <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\nisPhase_02 <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisPhase_03 <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nisBossDefeated <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n\nboss_X <span class=\"token operator\">=<\/span> <span class=\"token number\">672<\/span><span class=\"token punctuation\">;<\/span>\ngun <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span> obj_Gun<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncannonA <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">64<\/span><span class=\"token punctuation\">,<\/span> obj_Cannon<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncannonB <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">192<\/span><span class=\"token punctuation\">,<\/span> obj_Cannon<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\ncannonC <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">320<\/span><span class=\"token punctuation\">,<\/span> obj_Cannon<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> \n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u5efa\u7acb\u4e86\u4e09\u4e2a\u9636\u6bb5\u548c Boss \u662f\u5426\u88ab\u51fb\u8d25\u7684\u53d8\u91cf\u3002\u7136\u540e\u521b\u5efa\u4e86\u4e00\u4e2a Boss \u7684 X \u4f4d\u7f6e\u53d8\u91cf\uff0c\u5176\u4e2d\u5305\u62ec\u4e0d\u53ef\u6467\u6bc1\u7684\u4f4d\u4e8e\u623f\u95f4\u5de6\u4e0a\u89d2\u7684\u67aa\u548c Boss \u6240\u5728\u4f4d\u7f6e\u7684\u4e00\u5806\u5927\u70ae\u3002\u6211\u4eec\u4e3a Boss \u7684\u6bcf\u4e2a\u6b66\u5668\u5efa\u7acb\u53d8\u91cf\uff0c\u4ee5\u4fbf Boss \u53ef\u4ee5\u63a7\u5236\u5b83\u4eec\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u5927\u70ae\u6309\u987a\u5e8f\u5c04\u51fb\uff0c\u800c\u4e0d\u662f\u4e00\u8d77\u5c04\u51fb\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u65f6\u95f4\u8f74\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u8f74\u5e76\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      tm_Boss_Phase01<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <strong><br \/>\n      \u6307\u793a\u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      180<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u5c06\u5728\u6218\u6597\u5f00\u59cb\u540e\u7684\u516d\u79d2\u949f\u5185\u5f00\u59cb\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Phase01_180<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u53d1\u5c04\u4e2d\u95f4\u7684\u5927\u70ae\u3002\u5c06\u6b64\u811a\u672c\u5e94\u7528\u4e8e\u65f6\u95f4\u8f74\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>cannonB<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> cannonB<span class=\"token punctuation\">.<\/span>canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u7531\u4e8e\u73a9\u5bb6\u53ef\u4ee5\u6467\u6bc1\u5927\u70ae\uff0c\u6211\u4eec\u9700\u8981\u68c0\u67e5\u5927\u70ae\u662f\u5426\u4ecd\u7136\u5b58\u5728\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u5c06\u5927\u70ae\u7684<br \/>\n   <code><br \/>\n    canFire<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u8bbe\u7f6e\u4e3a true\uff0c\u5927\u70ae\u7684\u4ee3\u7801\u5c06\u5904\u7406\u5176\u4f59\u90e8\u5206\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      360<br \/>\n     <\/code><br \/>\n     \u5904\u6dfb\u52a0\u53e6\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Phase01_360<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u6fc0\u6d3b\u53e6\u5916\u4e24\u95e8\u5927\u70ae\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>cannonA<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> cannonA<span class=\"token punctuation\">.<\/span>canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>cannonC<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> cannonC<span class=\"token punctuation\">.<\/span>canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9700\u8981\u5206\u522b\u68c0\u67e5\u4e24\u95e8\u5927\u70ae\uff0c\u4ee5\u4fbf\u5982\u679c\u5176\u4e2d\u4e00\u95e8\u88ab\u6467\u6bc1\uff0c\u53e6\u4e00\u95e8\u4ecd\u7136\u4f1a\u5c04\u51fb\u3002\n  <\/p>\n<ol>\n<li>\n    \u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Boss_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u4ee3\u7801\u7684\u6700\u540e\u5f00\u59cb\u4e00\u4e2a\u5faa\u73af\u65f6\u95f4\u8f74\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">timeline_index <span class=\"token operator\">=<\/span> tm_Boss_Phase01<span class=\"token punctuation\">;<\/span>\ntimeline_running <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\ntimeline_loop <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u91cd\u65b0\u6253\u5f00<br \/>\n     <code><br \/>\n      BossArena<br \/>\n     <\/code><br \/>\n     \uff0c\u786e\u4fdd\u5982\u679c\u623f\u95f4\u5185\u4ecd\u6709\u67aa\u7684\u5b9e\u4f8b\uff0c\u5219\u5c06\u5176\u79fb\u9664\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u5730\u56fe\u7684\u53f3\u4fa7\u653e\u7f6e\u4e00\u4e2a<br \/>\n     <code><br \/>\n      obj_Boss<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\uff0c\u5b9e\u9645\u4f4d\u7f6e\u5e76\u4e0d\u91cd\u8981\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     Boss \u7684\u4efb\u4f55\u90e8\u5206\u90fd\u6ca1\u6709<br \/>\n     <strong><br \/>\n      \u56fa\u4f53<br \/>\n     <\/strong><br \/>\n     \u5c5e\u6027\uff0c\u8fd9\u610f\u5473\u7740\u73a9\u5bb6\u53ef\u4ee5\u7a7f\u8fc7\u5b83\u4eec\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u5728 Boss \u7684\u524d\u9762\u521b\u5efa\u4e00\u4e2a\u969c\u788d\u5899\uff0c\u4f7f\u7528<br \/>\n     <code><br \/>\n      obj_Ground<br \/>\n     <\/code><br \/>\n     \u7684\u5b9e\u4f8b\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff1a\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8fd0\u884c\u6e38\u620f\u3002\u5728\u5f00\u59cb\u65f6\uff0c\u6211\u4eec\u5e94\u8be5\u770b\u5230\u4e09\u95e8\u5927\u70ae\u5806\u53e0\u5728\u4e00\u8d77\uff0c\u8fd8\u6709\u4e00\u4e2a\u4e0d\u53ef\u6467\u6bc1\u7684\u67aa\u3002\u67aa\u5e94\u8be5\u7784\u51c6\u73a9\u5bb6\uff0c\u5e76\u6bcf\u9694\u51e0\u79d2\u949f\u5c04\u51fa\u4e00\u9897\u5b50\u5f39\u3002\u6e38\u620f\u8fdb\u884c\u5230\u7b2c\u516d\u79d2\u65f6\uff0c\u6211\u4eec\u5e94\u8be5\u770b\u5230\u4e2d\u95f4\u7684\u5927\u70ae\u5f00\u59cb\u5145\u80fd\uff0c\u5e76\u5f88\u5feb\u5c04\u51fa\u4e00\u9897\u70ae\u5f39\u3002\u518d\u8fc7\u516d\u79d2\uff0c\u4e0a\u4e0b\u4e24\u95e8\u5927\u70ae\u4e5f\u5e94\u8be5\u505a\u540c\u6837\u7684\u52a8\u4f5c\u3002\u5982\u679c\u73a9\u5bb6\u88ab\u654c\u4eba\u7684\u629b\u5c04\u7269\u51fb\u4e2d\uff0c\u4ed6\u4eec\u4f1a\u88ab\u51fb\u9000\u3002\u73a9\u5bb6\u7684\u5b50\u5f39\u4f1a\u4ece\u5927\u70ae\u65c1\u8fb9\u98de\u8fc7\uff0c\u9664\u975e\u5b83\u4eec\u88ab\u66b4\u9732\uff0c\u6b64\u65f6\u5927\u70ae\u5c06\u8fdb\u5165\u53d7\u635f\u72b6\u6001\uff0c\u5b50\u5f39\u4f1a\u6d88\u5931\u3002\u5982\u679c\u4efb\u4f55\u4e00\u95e8\u5927\u70ae\u88ab\u51fb\u4e2d\u4e24\u6b21\uff0c\u5b83\u5c06\u6d88\u5931\u3002\u7b2c\u4e00\u9636\u6bb5\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\uff0c\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u7684\u622a\u56fe\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<h3>\n   <a id=\"_1996\"><br \/>\n   <\/a><br \/>\n   \u6784\u5efa\u7b2c\u4e8c\u9636\u6bb5\uff1a\u5de8\u5927\u7684\u6fc0\u5149\u70ae<br \/>\n  <\/h3>\n<p>\n   \u4e00\u65e6\u73a9\u5bb6\u6467\u6bc1\u4e86\u6240\u6709\u7684\u5927\u70ae\uff0c\u7b2c\u4e8c\u9636\u6bb5\u5c31\u4f1a\u5f00\u59cb\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u6709\u4e00\u4e2a\u5de8\u5927\u7684\u6fc0\u5149\u70ae\uff0c\u4e0d\u65ad\u4e0a\u4e0b\u79fb\u52a8\u3002\u6bcf\u9694\u51e0\u79d2\u949f\uff0c\u5b83\u5c06\u53d1\u5c04\u4e00\u9053\u6a2a\u8de8\u6574\u4e2a\u623f\u95f4\u7684\u5de8\u5927\u6fc0\u5149\u675f\u3002\u73a9\u5bb6\u53ef\u4ee5\u968f\u65f6\u5bf9\u6fc0\u5149\u70ae\u9020\u6210\u4f24\u5bb3\uff0c\u5c3d\u7ba1\u5b83\u7684\u751f\u547d\u503c\u8981\u591a\u5f97\u591a\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u9996\u5148\u6211\u4eec\u5c06\u521b\u5efa\u6fc0\u5149\u675f\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_LaserBeam<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/LaserBeam.gif<br \/>\n     <\/code><br \/>\n     \uff0c\u4e0d\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u79fb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\u7cbe\u7075\u53ef\u80fd\u770b\u8d77\u6765\u5f88\u5c0f\uff0c\u53ea\u6709\u516b\u4e2a\u50cf\u7d20\u5bbd\uff0c\u4f46\u6211\u4eec\u5c06\u628a\u8fd9\u4e2a\u7cbe\u7075\u62c9\u4f38\u5230\u6574\u4e2a\u5c4f\u5e55\uff0c\u8fd9\u6837\u5b83\u53ef\u4ee5\u5728\u4efb\u4f55\u623f\u95f4\u4e2d\u4f7f\u7528\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u9700\u8981\u5c06\u539f\u70b9\u653e\u5728\u53f3\u4fa7\uff0c\u4ee5\u4fbf\u4e0e\u6fc0\u5149\u70ae\u7684\u67aa\u7ba1\u6b63\u786e\u5bf9\u9f50\u3002\u5c06<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      8<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      32<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_LaserBeam<br \/>\n     <\/code><br \/>\n     \uff0c\u5e94\u7528<br \/>\n     <code><br \/>\n      spr_LaserBeam<br \/>\n     <\/code><br \/>\n     \u4f5c\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -600<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_LaserBeam_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5728<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u521d\u59cb\u5316\u53d8\u91cf\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myDamage <span class=\"token operator\">=<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">;<\/span>\nmyLaserCannon <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> \nimage_xscale <span class=\"token operator\">=<\/span> room_width <span class=\"token operator\">\/<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u4e2a\u6b66\u5668\u7684\u4f24\u5bb3\u91cf\u6bd4\u5176\u4ed6\u6b66\u5668\u9ad8\u5f97\u591a\uff0c\u8fd9\u975e\u5e38\u9002\u5408\u7b2c\u4e8c\u9636\u6bb5\u3002\u6211\u4eec\u8fd8\u6709\u4e00\u4e2a<br \/>\n   <code><br \/>\n    myLaserCannon<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\uff0c\u5c06\u7528\u4e8e\u4f7f\u6fc0\u5149\u675f\u4e0e\u79fb\u52a8\u7684\u6fc0\u5149\u70ae\u4fdd\u6301\u5bf9\u9f50\u3002\u8be5\u503c\u5df2\u8bbe\u7f6e\u4e3a\u96f6\uff0c\u5c3d\u7ba1\u8fd9\u5c06\u6210\u4e3a\u751f\u6210\u5b83\u7684\u6fc0\u5149\u70ae\u7684 ID\uff0c\u6211\u4eec\u7a0d\u540e\u4f1a\u8ba8\u8bba\u3002\u6700\u540e\uff0c\u6211\u4eec\u5c06\u7cbe\u7075\u62c9\u4f38\u5230\u6574\u4e2a\u623f\u95f4\u3002\u53d8\u91cf<br \/>\n   <code><br \/>\n    image_xscale<br \/>\n   <\/code><br \/>\n   \u662f\u4e00\u4e2a\u4e58\u6570\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u8981\u5c06\u623f\u95f4\u5bbd\u5ea6\u9664\u4ee5\u516b\uff0c\u5373\u7cbe\u7075\u7684\u5bbd\u5ea6\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u7ed3\u675f\u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u4f7f\u7528\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_LaserBeam_EndStep<br \/>\n    <\/code><br \/>\n    \uff0c\u4f7f\u6fc0\u5149\u70ae\u7684\u6fc0\u5149\u675f\u79fb\u52a8\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">x <span class=\"token operator\">=<\/span> myLaserCannon<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">;<\/span>\ny <span class=\"token operator\">=<\/span> myLaserCannon<span class=\"token punctuation\">.<\/span>y<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u4f7f\u7528\u521b\u5efa\u6fc0\u5149\u675f\u7684\u6fc0\u5149\u70ae\u7684 X \u548c Y \u5750\u6807\u3002\u6211\u4eec\u5c06\u5176\u653e\u5165<br \/>\n   <strong><br \/>\n    End Step<br \/>\n   <\/strong><br \/>\n   \u4e8b\u4ef6\u4e2d\uff0c\u56e0\u4e3a\u6fc0\u5149\u70ae\u5c06\u5728<br \/>\n   <strong><br \/>\n    Step<br \/>\n   <\/strong><br \/>\n   \u4e8b\u4ef6\u4e2d\u79fb\u52a8\uff0c\u8fd9\u5c06\u786e\u4fdd\u5b83\u59cb\u7ec8\u5904\u4e8e\u6b63\u786e\u7684\u4f4d\u7f6e\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u73b0\u5728\u53ea\u5269\u4e0b\u5c06<br \/>\n     <code><br \/>\n      scr_Damage<br \/>\n     <\/code><br \/>\n     \u6dfb\u52a0\u5230<br \/>\n     <strong><br \/>\n      Collision<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      obj_Player<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u3002\u6fc0\u5149\u675f\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\u662f\u6fc0\u5149\u70ae\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e09\u4e2a\u7cbe\u7075\uff1a<br \/>\n     <code><br \/>\n      spr_LaserCannon_Idle<br \/>\n     <\/code><br \/>\n     \uff0c<br \/>\n     <code><br \/>\n      spr_LaserCannon_Run<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_LaserCannon_Damage<br \/>\n     <\/code><br \/>\n     \u3002\u4ece<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/<br \/>\n     <\/code><br \/>\n     \u6587\u4ef6\u5939\u4e2d\u52a0\u8f7d\u76f8\u5173\u6587\u4ef6\uff0c\u6240\u6709\u6587\u4ef6\u90fd\u9700\u8981\u52fe\u9009<br \/>\n     <strong><br \/>\n      Remove Background<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06\u6240\u6709\u4e09\u4e2a\u7cbe\u7075\u7684<br \/>\n     <strong><br \/>\n      Origin<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      16<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      56<br \/>\n     <\/code><br \/>\n     \u3002\u8fd9\u5c06\u6709\u52a9\u4e8e\u5c06\u6fc0\u5149\u675f\u653e\u7f6e\u5728\u6211\u4eec\u60f3\u8981\u7684\u4f4d\u7f6e\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_LaserCannon<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_LaserCannon _Idle<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      Sprite<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <strong><br \/>\n      Depth<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -700<br \/>\n     <\/code><br \/>\n     \uff0c\u4ee5\u4fbf\u6fc0\u5149\u70ae\u4f4d\u4e8e\u70ae\u53f0\u548c\u67aa\u7684\u540e\u9762\uff0c\u4f46\u5728\u6fc0\u5149\u675f\u7684\u524d\u9762\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u521d\u59cb\u5316\u53d8\u91cf\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Laser_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u4ee3\u7801\u5982\u4e0b\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myHealth <span class=\"token operator\">=<\/span> <span class=\"token number\">50<\/span><span class=\"token punctuation\">;<\/span>\nmySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\nmyBuffer <span class=\"token operator\">=<\/span> <span class=\"token number\">64<\/span><span class=\"token punctuation\">;<\/span>\naction <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\nfacing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\ncanFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n\nmyIdle <span class=\"token operator\">=<\/span> spr_LaserCannon _Idle<span class=\"token punctuation\">;<\/span>\nmyRun <span class=\"token operator\">=<\/span> spr_LaserCannon _Run<span class=\"token punctuation\">;<\/span>\nmyDamage <span class=\"token operator\">=<\/span> spr_LaserCannon _Damage<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u8bbe\u7f6e\u6fc0\u5149\u70ae\u7684\u5065\u5eb7\u3001\u5f53\u524d\u72b6\u6001\u3001\u9762\u5411\u65b9\u5411\u548c\u975e\u5c04\u51fb\u7684\u6240\u6709\u6807\u51c6\u53d8\u91cf\u3002\u7136\u540e\u8bbe\u7f6e\u6fc0\u5149\u70ae\u7684\u4e09\u79cd\u72b6\u6001\u7684\u6240\u6709\u52a8\u753b\u7cfb\u7edf\u53d8\u91cf\u3002\n  <\/p>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\u662f\u6784\u5efa\u6fc0\u5149\u7684\u529f\u80fd\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_LaserCannon_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>image_index <span class=\"token operator\">&gt;<\/span> image_number<span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>canFire<span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">RUN<\/span><span class=\"token punctuation\">;<\/span>\n    alarm<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span>\n    canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>myHealth <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u8fd9\u5e94\u8be5\u5f00\u59cb\u770b\u8d77\u6765\u76f8\u5f53\u719f\u6089\u4e86\u3002\u6211\u4eec\u9996\u5148\u8fd0\u884c\u52a8\u753b\u7cfb\u7edf\u811a\u672c\u3002\u7136\u540e\u68c0\u67e5\u52a8\u753b\u7684\u6700\u540e\u4e00\u5e27\u662f\u5426\u5df2\u64ad\u653e\uff0c\u5982\u679c\u662f\uff0c\u5219\u5c06\u6fc0\u5149\u70ae\u8bbe\u7f6e\u4e3a\u5f85\u673a\u72b6\u6001\u3002\u63a5\u4e0b\u6765\uff0c\u5982\u679c\u6fc0\u5149\u70ae\u8981\u5c04\u51fb\uff0c\u6211\u4eec\u6539\u53d8\u72b6\u6001\u5e76\u8bbe\u7f6e\u4e00\u4e2a\u77ed\u6682\u7684\u8b66\u62a5\uff0c\u4ee5\u4fbf\u5728\u5c04\u51fb\u52a8\u753b\u64ad\u653e\u540e\u521b\u5efa\u6fc0\u5149\u675f\u3002\u6700\u540e\uff0c\u6211\u4eec\u8fdb\u884c\u5065\u5eb7\u68c0\u67e5\uff0c\u5e76\u5728\u5065\u5eb7\u72b6\u51b5\u4e0d\u4f73\u65f6\u79fb\u9664\u6fc0\u5149\u70ae\u3002\n  <\/p>\n<p>\n   \u8fd9\u4e2a\u811a\u672c\u8fd8\u6ca1\u6709\u5b8c\u6210\u3002\u6211\u4eec\u4ecd\u7136\u9700\u8981\u6dfb\u52a0\u79fb\u52a8\u3002\u5f53\u6fc0\u5149\u70ae\u9996\u6b21\u521b\u5efa\u65f6\uff0c\u5b83\u4e0d\u4f1a\u79fb\u52a8\u3002\u6211\u4eec\u5e0c\u671b\u5b83\u5728\u7b2c\u4e8c\u9636\u6bb5\u5f00\u59cb\u540e\u624d\u5f00\u59cb\u79fb\u52a8\u3002\u5728\u90a3\u4e4b\u540e\uff0c\u6211\u4eec\u5e0c\u671b\u6fc0\u5149\u70ae\u8d1f\u8d23\u5782\u76f4\u8fd0\u52a8\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e3a\u4e86\u8ba9\u6fc0\u5149\u70ae\u4e0a\u4e0b\u79fb\u52a8\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u5b83\u901a\u8fc7\u7ec8\u70b9\u65f6\u53d1\u9001\u76f8\u53cd\u65b9\u5411\u7684\u6307\u4ee4\u3002\u5728<br \/>\n    <code><br \/>\n     scr_LaserCannon_Step<br \/>\n    <\/code><br \/>\n    \u7684\u6700\u540e\u4e00\u884c\u4ee3\u7801\u4e4b\u540e\u7acb\u5373\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>y <span class=\"token operator\">&lt;<\/span> myBuffer<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    vspeed <span class=\"token operator\">=<\/span> mySpeed<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>y <span class=\"token operator\">&gt;<\/span> room_height <span class=\"token operator\">-<\/span> myBuffer<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    vspeed <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span>mySpeed<span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span> \n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u5c06\u8ba9\u6fc0\u5149\u70ae\u5728\u6574\u4e2a\u623f\u95f4\u7684\u9ad8\u5ea6\u4e0a\u79fb\u52a8\u3002\u5982\u679c Y \u5750\u6807\u8ddd\u79bb\u9876\u90e8\u5c0f\u4e8e 64 \u50cf\u7d20\uff0c\u6211\u4eec\u5c06\u5176\u5411\u4e0b\u79fb\u52a8\u3002\u5982\u679c\u8ddd\u79bb\u623f\u95f4\u5e95\u90e8\u5927\u4e8e 64 \u50cf\u7d20\uff0c\u6211\u4eec\u5c06\u5176\u5411\u4e0a\u79fb\u52a8\u3002\u6211\u4eec\u5c06\u5728 Boss \u811a\u672c\u4e2d\u5f00\u59cb\u79fb\u52a8\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8ba9\u6fc0\u5149\u70ae\u5c04\u51fa\u6fc0\u5149\u675f\uff01\u6fc0\u5149\u675f\u5c06\u5728<br \/>\n     <strong><br \/>\n      Alarm<br \/>\n     <\/strong><br \/>\n     |<br \/>\n     <strong><br \/>\n      Alarm 0<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\u4e2d\u521b\u5efa\uff0c\u9644\u52a0\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n     <code><br \/>\n      scr_LaserCannon_Alarm0<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u6fc0\u5149\u675f\u521b\u5efa\u7684\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">beam <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">,<\/span> y<span class=\"token punctuation\">,<\/span> obj_LaserBeam<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nbeam<span class=\"token punctuation\">.<\/span>myLaserCannon <span class=\"token operator\">=<\/span> self<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u5728\u6fc0\u5149\u70ae\u7684\u5c16\u7aef\u521b\u5efa\u4e00\u4e2a\u6fc0\u5149\u675f\u7684\u5b9e\u4f8b\uff0c\u7136\u540e\u5c06\u6fc0\u5149\u675f\u7684<br \/>\n   <code><br \/>\n    myLaserCannon<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\u8bbe\u7f6e\u4e3a\u521b\u5efa\u5b83\u7684\u6fc0\u5149\u70ae\u7684\u552f\u4e00 ID\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\uff0c\u5982\u679c\u9700\u8981\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u623f\u95f4\u4e2d\u653e\u7f6e\u591a\u4e2a\u6fc0\u5149\u70ae\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u6784\u5efa\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u662f\u4f24\u5bb3\u72b6\u6001\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_LaserCannon_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u653e\u5165<br \/>\n    <strong><br \/>\n     Collision<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     obj_Bullet<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>obj_Boss<span class=\"token punctuation\">.<\/span>isPhase_02<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    myHealth <span class=\"token operator\">-=<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>other<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u7531\u4e8e\u6211\u4eec\u4e0d\u5e0c\u671b\u73a9\u5bb6\u5728\u7b2c\u4e8c\u9636\u6bb5\u4e4b\u524d\u5c31\u80fd\u6467\u6bc1\u6fc0\u5149\u70ae\uff0c\u56e0\u6b64\u6211\u4eec\u68c0\u67e5 Boss \u5f53\u524d\u6240\u5904\u7684\u9636\u6bb5\uff0c\u4ee5\u786e\u5b9a\u662f\u5426\u5e94\u8be5\u65bd\u52a0\u4f24\u5bb3\u3002\u5982\u679c Boss \u5904\u4e8e\u7b2c\u4e8c\u9636\u6bb5\uff0c\u6211\u4eec\u4f1a\u51cf\u5c11\u6fc0\u5149\u70ae\u7684\u751f\u547d\u503c\uff0c\u5c06\u5176\u6539\u4e3a\u53d7\u635f\u72b6\u6001\u5e76\u79fb\u9664\u5b50\u5f39\u3002\u6fc0\u5149\u70ae\u73b0\u5728\u5df2\u7ecf\u5b8c\u6574\uff0c\u5e76\u51c6\u5907\u597d\u5b9e\u73b0\u5230 Boss \u4e2d\u3002\n  <\/p>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u662f\u6dfb\u52a0\u4e00\u4e2a\u6fc0\u5149\u70ae\u7684\u5b9e\u4f8b\u3002\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Boss_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u8fd0\u884c\u65f6\u95f4\u8f74\u4e4b\u524d\u63d2\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">laser <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">352<\/span><span class=\"token punctuation\">,<\/span> obj_LaserCannon<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u8f74\u5e76\u547d\u540d\u4e3a<br \/>\n     <code><br \/>\n      tm_Boss_Phase02<br \/>\n     <\/code><br \/>\n     \u6765\u6784\u5efa LaserCannon \u7684\u529f\u80fd\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u8981\u53d1\u5c04\u6fc0\u5149\u675f\uff0c\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \u5e76\u5c06<br \/>\n     <strong><br \/>\n      \u6307\u793a\u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      210<br \/>\n     <\/code><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Phase02_210<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06\u5176\u4e0e\u6fc0\u6d3b LaserCannon \u7684\u4ee3\u7801\u5206\u914d\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">laser<span class=\"token punctuation\">.<\/span>canFire <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u5e0c\u671b\u5b8c\u5168\u63a7\u5236 LaserCannon \u7684\u6301\u7eed\u65f6\u95f4\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u4f7f\u7528\u65f6\u95f4\u8f74\u6765\u79fb\u9664\u6fc0\u5149\u675f\u3002\u5728<br \/>\n     <code><br \/>\n      270<br \/>\n     <\/code><br \/>\n     \u5904\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      \u65f6\u523b<br \/>\n     <\/strong><br \/>\n     \u3002\u8fd9\u5c06\u7ed9\u6211\u4eec\u4e00\u4e2a\u6301\u7eed\u4e24\u79d2\u7684\u6fc0\u5149\u675f\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_Phase02_270<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u79fb\u9664\u6fc0\u5149\u675f\u3002\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>laser<span class=\"token punctuation\">.<\/span>beam<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u5f53 LaserCannon \u5c04\u51fb\u65f6\uff0c\u5b83\u4f1a\u521b\u5efa<br \/>\n   <code><br \/>\n    beam<br \/>\n   <\/code><br \/>\n   \u53d8\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u79fb\u9664\u5b83\u3002\n  <\/p>\n<ol>\n<li>\n    \u552f\u4e00\u5269\u4e0b\u7684\u5c31\u662f\u8ba9 Boss \u4ece\u7b2c\u4e00\u9636\u6bb5\u53d8\u4e3a\u7b2c\u4e8c\u9636\u6bb5\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9700\u8981\u5728<br \/>\n    <code><br \/>\n     obj_Boss<br \/>\n    <\/code><br \/>\n    \u4e0a\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Boss_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_Cannon<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token operator\">!<\/span>isPhase_02<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    laser<span class=\"token punctuation\">.<\/span>vspeed <span class=\"token operator\">=<\/span> laser<span class=\"token punctuation\">.<\/span>mySpeed<span class=\"token punctuation\">;<\/span>\n    timeline_index <span class=\"token operator\">=<\/span> tm_Boss_Phase02<span class=\"token punctuation\">;<\/span>\n    timeline_position <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    gun<span class=\"token punctuation\">.<\/span>delay <span class=\"token operator\">=<\/span> <span class=\"token number\">45<\/span><span class=\"token punctuation\">;<\/span>\n    isPhase_02 <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u4e16\u754c\u4e2d\u662f\u5426\u8fd8\u6709 Cannon \u7684\u5b9e\u4f8b\uff0c\u5982\u679c\u5b83\u4eec\u90fd\u88ab\u6467\u6bc1\u4e86\uff0c\u6211\u4eec\u68c0\u67e5\u7b2c\u4e8c\u9636\u6bb5\u662f\u5426\u5df2\u7ecf\u5f00\u59cb\u3002\u7b2c\u4e8c\u9636\u6bb5\u5f00\u59cb\u65f6\uff0c\u6211\u4eec\u5c06 LaserCannon \u5411\u4e0b\u79fb\u52a8\uff0c\u5e76\u5207\u6362\u65f6\u95f4\u8f74\u5230\u65b0\u9636\u6bb5\uff0c\u5e76\u5c06\u65f6\u95f4\u8f74\u91cd\u7f6e\u5230\u5f00\u59cb\u3002\u6211\u4eec\u8fd8\u5c06\u901a\u8fc7\u51cf\u5c11 Gun \u5c04\u51fb\u4e4b\u95f4\u7684\u5ef6\u8fdf\u6765\u589e\u52a0\u6311\u6218\u7684\u96be\u5ea6\u3002\u6700\u540e\uff0c\u6211\u4eec\u5c06<br \/>\n   <code><br \/>\n    isPhase_02<br \/>\n   <\/code><br \/>\n   \u66f4\u6539\u4e3a true\uff0c\u4ee5\u4fbf\u8fd9\u4e2a\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002\n  <\/p>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u6e38\u620f\u73a9\u6cd5\u5f00\u59cb\u4e0e\u4ee5\u524d\u76f8\u540c\uff0c\u4f46\u5728\u4e09\u4e2a Cannon \u88ab\u6467\u6bc1\u540e\uff0c\u6211\u4eec\u5e94\u8be5\u770b\u5230 LaserCannon \u5f00\u59cb\u4e0a\u4e0b\u79fb\u52a8\uff0c\u5e76\u4e14\u6bcf\u4e03\u79d2\u53d1\u5c04\u4e00\u6b21\u6fc0\u5149\u675f\u3002LaserCannon \u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u88ab\u51fb\u4e2d\uff0c\u5e76\u4e14\u9700\u8981\u591a\u6b21\u51fb\u4e2d\u624d\u80fd\u88ab\u6467\u6bc1\u3002\u65e0\u6cd5\u6467\u6bc1\u7684 Gun \u5e94\u8be5\u4ecd\u7136\u50cf\u4ee5\u524d\u4e00\u6837\u8fd0\u884c\uff0c\u4f46\u662f\u5c04\u51fb\u9891\u7387\u589e\u52a0\u4e86\u4e00\u500d\u3002\u7b2c\u4e8c\u9636\u6bb5\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\uff0c\u5e76\u4e14\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4ee5\u4e0b\u622a\u56fe\uff1a\n   <\/li>\n<\/ol>\n<h3>\n   <a id=\"_Boss_Core_2159\"><br \/>\n   <\/a><br \/>\n   \u8bbe\u7f6e\u6700\u7ec8\u9636\u6bb5\uff1a\u6709\u62a4\u76fe\u7684 Boss Core<br \/>\n  <\/h3>\n<p>\n   \u5bf9\u4e8e\u6700\u540e\u9636\u6bb5\uff0c\u6211\u4eec\u4e0d\u4f1a\u6dfb\u52a0\u53e6\u4e00\u79cd\u6b66\u5668\uff0c\u800c\u662f\u521b\u5efa\u4e00\u4e2a\u53d7\u5230\u4e24\u4e2a\u62a4\u76fe\u4fdd\u62a4\u7684\u53ef\u6467\u6bc1\u7684 Boss Core\u3002\u62a4\u76fe\u5c06\u6bcf\u9694\u51e0\u79d2\u6253\u5f00\u4e00\u6b21\uff0c\u4ee5\u66b4\u9732 Boss Core\u3002\u6211\u4eec\u8fd8\u5c06\u6539\u53d8 Gun\uff0c\u4f7f\u5176\u5feb\u901f\u8fde\u53d1\uff1a\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u5c06\u4ece Boss Core \u5f00\u59cb\u3002\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e24\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_BossCore_Idle<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_BossCore_Damage<br \/>\n     <\/code><br \/>\n     \u3002\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u79fb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \uff0c\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/BossCore_Idle.gif<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/BossCore_Damage.gif<br \/>\n     <\/code><br \/>\n     \u5230\u76f8\u5e94\u7684\u7cbe\u7075\u4e0a\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06\u4e24\u4e2a\u7cbe\u7075\u7684<br \/>\n     <strong><br \/>\n      \u539f\u70b9<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      -32<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      64<br \/>\n     <\/code><br \/>\n     \uff0c\u8fd9\u6837\u5b83\u4eec\u5c06\u6b63\u786e\u5730\u4f4d\u4e8e\u62a4\u76fe\u540e\u9762\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_BossCore<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5c06<br \/>\n     <code><br \/>\n      spr_BossCore_Idle<br \/>\n     <\/code><br \/>\n     \u5206\u914d\u4e3a<br \/>\n     <strong><br \/>\n      \u7cbe\u7075<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     Boss Core \u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5bf9\u8c61\uff0c\u53ea\u9700\u8981\u4e00\u4e9b\u52a8\u753b\u72b6\u6001\u548c\u751f\u547d\u503c\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n     <code><br \/>\n      scr_BossCore_Create<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u521d\u59cb\u5316\u6240\u9700\u7684\u53d8\u91cf\u5982\u4e0b\u3002\u8bb0\u5f97\u5c06\u5176\u5206\u914d\u7ed9<br \/>\n     <strong><br \/>\n      \u521b\u5efa<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">myHealth <span class=\"token operator\">=<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">;<\/span>\naction <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\nfacing <span class=\"token operator\">=<\/span> <span class=\"token constant\">RIGHT<\/span><span class=\"token punctuation\">;<\/span>\n\nmyIdle <span class=\"token operator\">=<\/span> spr_BossCore_Idle<span class=\"token punctuation\">;<\/span>\nmyDamage <span class=\"token operator\">=<\/span> spr_BossCore_Damage<span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     \u6b65\u9aa4<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u6765\u63a7\u5236\u52a8\u753b\u72b6\u6001\u548c\u5904\u7406\u751f\u547d\u503c\uff0c\u56e0\u6b64\u521b\u5efa\u53e6\u4e00\u4e2a\u65b0\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_BossCore_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token function\">scr_Animation_Control<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>action <span class=\"token operator\">==<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">)<\/span> \n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>image_index <span class=\"token operator\">&gt;<\/span> image_number<span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">{<!-- --><\/span>\n        action <span class=\"token operator\">=<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>myHealth <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    Boss Core \u73b0\u5728\u6240\u9700\u8981\u7684\u5c31\u662f\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     \u78b0\u649e<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     obj_Bullet<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u6765\u5904\u7406\u4f24\u5bb3\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c<br \/>\n    <code><br \/>\n     scr_BossCore_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>obj_Boss<span class=\"token punctuation\">.<\/span>isPhase_03 <span class=\"token operator\">&amp;&amp;<\/span> action <span class=\"token operator\">==<\/span> <span class=\"token constant\">IDLE<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    myHealth <span class=\"token operator\">-=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\n    action <span class=\"token operator\">=<\/span> <span class=\"token constant\">DAMAGE<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>other<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5 Boss \u662f\u5426\u5904\u4e8e\u6700\u7ec8\u9636\u6bb5\uff0c\u5e76\u4e14 Boss Core \u5904\u4e8e\u7a7a\u95f2\u72b6\u6001\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u51cf\u5c11\u751f\u547d\u503c\u5e76\u5207\u6362\u5230\u53d7\u635f\u52a8\u753b\u3002\u6211\u4eec\u8fd8\u786e\u4fdd\u5b50\u5f39\u88ab\u79fb\u9664\u3002Boss Core \u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\uff0c\u6211\u4eec\u53ef\u4ee5\u8f6c\u79fb\u5230\u62a4\u76fe\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u6211\u4eec\u5c06\u6709\u4e24\u4e2a\u62a4\u76fe\uff0c\u4e00\u4e2a\u662f\u4e0a\u5347\u7684\uff0c\u53e6\u4e00\u4e2a\u662f\u4e0b\u964d\u7684\u3002\u8ba9\u6211\u4eec\u5f15\u5165\u6211\u4eec\u9700\u8981\u7684\u4e24\u4e2a\u7cbe\u7075\u3002\u521b\u5efa\u4e24\u4e2a\u65b0\u7684\u7cbe\u7075\uff0c<br \/>\n     <code><br \/>\n      spr_Shield_Upper<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      spr_Shield_Lower<br \/>\n     <\/code><br \/>\n     \u3002\u52a0\u8f7d<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Shield_Upper.gif<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      Chapter 5\/Sprites\/Shield_Lower.gif<br \/>\n     <\/code><br \/>\n     \u5230\u76f8\u5e94\u7684\u7cbe\u7075\u4e0a\u3002\u8bb0\u5f97\u52fe\u9009<br \/>\n     <strong><br \/>\n      \u79fb\u9664\u80cc\u666f<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5c06<br \/>\n     <code><br \/>\n      spr_Shield_Upper<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      Origin<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <strong><br \/>\n      X<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      0<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <strong><br \/>\n      Y<br \/>\n     <\/strong><br \/>\n     \uff1a<br \/>\n     <code><br \/>\n      269<br \/>\n     <\/code><br \/>\n     \uff0c\u4ee5\u4fbf\u539f\u70b9\u4f4d\u4e8e\u56fe\u50cf\u5e95\u90e8\u3002\u6211\u4eec\u4e0d\u9700\u8981\u66f4\u6539<br \/>\n     <code><br \/>\n      spr_Shield_Lower<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      Origin<br \/>\n     <\/strong><br \/>\n     \u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u521b\u5efa\u4e24\u4e2a\u65b0\u5bf9\u8c61\uff0c<br \/>\n     <code><br \/>\n      obj_Shield_Upper<br \/>\n     <\/code><br \/>\n     \u548c<br \/>\n     <code><br \/>\n      obj_Shield_Lower<br \/>\n     <\/code><br \/>\n     \uff0c\u5e76\u5206\u914d\u9002\u5f53\u7684\u7cbe\u7075\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728\u4e24\u4e2a\u62a4\u76fe\u4e0a\uff0c\u5c06<br \/>\n     <strong><br \/>\n      \u6df1\u5ea6<br \/>\n     <\/strong><br \/>\n     \u8bbe\u7f6e\u4e3a<br \/>\n     <code><br \/>\n      -500<br \/>\n     <\/code><br \/>\n     \uff0c\u8fd9\u6837\u5b83\u4eec\u5c31\u5728 Boss \u6838\u5fc3\u7684\u524d\u9762\uff0c\u4f46\u5728 Boss \u7684\u6240\u6709\u5176\u4ed6\u90e8\u5206\u7684\u540e\u9762\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u6211\u4eec\u5c06\u9996\u5148\u5efa\u9020\u4e0a\u5c42\u62a4\u76fe\uff0c\u5e76\u4e14\u6211\u4eec\u9700\u8981\u5728\u4e00\u4e2a\u65b0\u7684\u811a\u672c<br \/>\n     <code><br \/>\n      scr_ShieldUpper_Create<br \/>\n     <\/code><br \/>\n     \u4e2d\u521d\u59cb\u5316\u4e00\u4e9b\u53d8\u91cf\uff0c\u5e94\u7528\u4e8e<br \/>\n     <code><br \/>\n      obj_Shield_Upper<br \/>\n     <\/code><br \/>\n     \u7684<br \/>\n     <strong><br \/>\n      Create<br \/>\n     <\/strong><br \/>\n     \u4e8b\u4ef6\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\nopenPosition <span class=\"token operator\">=<\/span> y<span class=\"token operator\">-<\/span><span class=\"token number\">64<\/span><span class=\"token punctuation\">;<\/span>\nmySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u7b2c\u4e00\u4e2a\u53d8\u91cf\u5c06\u6fc0\u6d3b\u62a4\u76fe\u662f\u4e0a\u5347\u8fd8\u662f\u4e0b\u964d\u3002\u7b2c\u4e8c\u4e2a\u53d8\u91cf\u8bbe\u7f6e\u62ac\u8d77\u62a4\u76fe\u7684\u9ad8\u5ea6\u503c\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5b83\u5c06\u4e0a\u5347 64 \u50cf\u7d20\u3002\u6700\u540e\uff0c\u6211\u4eec\u8bbe\u7f6e\u4e00\u4e2a\u79fb\u52a8\u901f\u5ea6\u7684\u53d8\u91cf\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e0b\u5c42\u62a4\u76fe\u51e0\u4e4e\u5b8c\u5168\u76f8\u540c\uff0c\u53ea\u662f\u79fb\u52a8\u65b9\u5411\u76f8\u53cd\u3002\u518d\u6b21\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_ShieldLower_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5c06\u5176\u5e94\u7528\u4e8e<br \/>\n    <code><br \/>\n     obj_Shield_Lower<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     Create<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\nopenPosition <span class=\"token operator\">=<\/span> y<span class=\"token operator\">+<\/span><span class=\"token number\">64<\/span><span class=\"token punctuation\">;<\/span>\nmySpeed <span class=\"token operator\">=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5728<br \/>\n    <code><br \/>\n     obj_Shield_Upper<br \/>\n    <\/code><br \/>\n    \u4e0a\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u9644\u52a0\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_ShieldUpper_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\u6765\u63a7\u5236\u62a4\u76fe\u7684\u79fb\u52a8\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isShielding <span class=\"token operator\">&amp;&amp;<\/span> y <span class=\"token operator\">&lt;<\/span> ystart<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> y <span class=\"token operator\">+=<\/span> mySpeed<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>isShielding <span class=\"token operator\">&amp;&amp;<\/span> y <span class=\"token operator\">&gt;<\/span> openPosition<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> y <span class=\"token operator\">-=<\/span> mySpeed<span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span> \n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u9996\u5148\u68c0\u67e5\u62a4\u76fe\u662f\u5426\u5e94\u8be5\u5173\u95ed\uff0c\u4ee5\u53ca\u5b83\u662f\u5426\u5b8c\u5168\u5173\u95ed\u3002\u5982\u679c\u6ca1\u6709\u5b8c\u5168\u5173\u95ed\uff0c\u6211\u4eec\u5c06\u62a4\u76fe\u7a0d\u5fae\u5173\u95ed\u4e00\u70b9\u3002\u7b2c\u4e8c\u4e2a<br \/>\n   <code><br \/>\n    if<br \/>\n   <\/code><br \/>\n   \u8bed\u53e5\u5219\u76f8\u53cd\uff0c\u68c0\u67e5\u62a4\u76fe\u662f\u5426\u5e94\u8be5\u6253\u5f00\uff0c\u4ee5\u53ca\u5b83\u662f\u5426\u5b8c\u5168\u6253\u5f00\u3002\u5982\u679c\u6ca1\u6709\uff0c\u6211\u4eec\u5c06\u62ac\u8d77\u62a4\u76fe\u4e00\u70b9\u3002\n  <\/p>\n<ol>\n<li>\n    \u4e0b\u5c42\u62a4\u76fe\u51e0\u4e4e\u5b8c\u5168\u76f8\u540c\u3002\u5728<br \/>\n    <code><br \/>\n     obj_Shield_Lower<br \/>\n    <\/code><br \/>\n    \u7684<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     Step<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\u4e2d\u518d\u6b21\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_ShieldLower_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u9644\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>isShielding <span class=\"token operator\">&amp;&amp;<\/span> y <span class=\"token operator\">&gt;<\/span> ystart<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> y <span class=\"token operator\">-=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>isShielding <span class=\"token operator\">&amp;&amp;<\/span> y <span class=\"token operator\">&lt;<\/span> openPosition<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> y <span class=\"token operator\">+=<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u6211\u4eec\u9700\u8981\u5904\u7406\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u662f<br \/>\n    <strong><br \/>\n     Collision<br \/>\n    <\/strong><br \/>\n    |<br \/>\n    <strong><br \/>\n     obj_Bullet<br \/>\n    <\/strong><br \/>\n    \u4e8b\u4ef6\uff0c\u4e24\u4e2a\u62a4\u76fe\u90fd\u53ef\u4ee5\u4f7f\u7528\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Shield_Collision<br \/>\n    <\/code><br \/>\n    \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>obj_Boss<span class=\"token punctuation\">.<\/span>isPhase_03<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>other<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u62a4\u76fe\u6c38\u8fdc\u4e0d\u4f1a\u53d7\u5230\u4f24\u5bb3\uff0c\u4f46\u5b83\u4eec\u53ea\u5e94\u5728\u6700\u540e\u9636\u6bb5\u68c0\u6d4b\u78b0\u649e\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6240\u6709\u5bf9\u8c61\u90fd\u5df2\u51c6\u5907\u5c31\u7eea\uff0c\u662f\u65f6\u5019\u5c06\u5b83\u4eec\u5b9e\u73b0\u5230 Boss \u4e2d\u4e86\u3002\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Boss_Create<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u6700\u540e\u4e00\u4e2a\u6b66\u5668\u540e\u63d2\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">core <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">272<\/span><span class=\"token punctuation\">,<\/span> obj_BossCore<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nshieldUpper <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">272<\/span><span class=\"token punctuation\">,<\/span> obj_Shield_Upper<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\nshieldLower <span class=\"token operator\">=<\/span> <span class=\"token function\">instance_create<\/span><span class=\"token punctuation\">(<\/span>boss_X<span class=\"token punctuation\">,<\/span> <span class=\"token number\">272<\/span><span class=\"token punctuation\">,<\/span> obj_Shield_Lower<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u5728\u540c\u4e00\u4f4d\u7f6e\u521b\u5efa Boss \u6838\u5fc3\u548c\u62a4\u76fe\u3002\n  <\/p>\n<ol>\n<li>\n<p>\n     \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u65f6\u95f4\u8f74<br \/>\n     <code><br \/>\n      tm_Boss_Phase03<br \/>\n     <\/code><br \/>\n     \u6765\u5904\u7406\u62a4\u76fe\u548c\u67aa\u7684\u529f\u80fd\u3002\n    <\/p>\n<\/li>\n<li>\n<p>\n     \u5728<br \/>\n     <code><br \/>\n      120<br \/>\n     <\/code><br \/>\n     \u5904\u6dfb\u52a0\u4e00\u4e2a<br \/>\n     <strong><br \/>\n      Moment<br \/>\n     <\/strong><br \/>\n     \uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n     <code><br \/>\n      scr_Phase03_120<br \/>\n     <\/code><br \/>\n     \uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u4ee3\u7801\uff1a\n    <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">shieldUpper<span class=\"token punctuation\">.<\/span>isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\nshieldLower<span class=\"token punctuation\">.<\/span>isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span> \ngun<span class=\"token punctuation\">.<\/span>delay <span class=\"token operator\">=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p>\n   \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6b63\u5728\u8bbe\u7f6e\u62a4\u76fe\u6253\u5f00\uff0c\u5e76\u589e\u52a0\u67aa\u7684\u5c04\u51fb\u901f\u7387\u3002\n  <\/p>\n<ol>\n<li>\n    \u5728<br \/>\n    <code><br \/>\n     180<br \/>\n    <\/code><br \/>\n    \u5904\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Moment<br \/>\n    <\/strong><br \/>\n    \uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Phase03_180<br \/>\n    <\/code><br \/>\n    \u3002\u6211\u4eec\u8981\u505a\u7684\u5c31\u662f\u5173\u95ed\u67aa\u7684\u8b66\u62a5\uff0c\u4ee5\u4fbf\u5c04\u51fb\u6709\u4e00\u4e2a\u77ed\u6682\u7684\u4f11\u606f\u3002\u8fd9\u662f\u901a\u8fc7\u5c06\u5ef6\u8fdf\u8bbe\u7f6e\u4e3a-1 \u6765\u5b9e\u73b0\u7684\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">gun<span class=\"token punctuation\">.<\/span>delay <span class=\"token operator\">=<\/span> <span class=\"token operator\">-<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u5728<br \/>\n    <code><br \/>\n     300<br \/>\n    <\/code><br \/>\n    \u5904\u6dfb\u52a0\u53e6\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Moment<br \/>\n    <\/strong><br \/>\n    \uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Phase03_300<br \/>\n    <\/code><br \/>\n    \u3002\u73b0\u5728\u6211\u4eec\u91cd\u65b0\u6fc0\u6d3b\u67aa\u7684\u8b66\u62a5\u3002\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">gun<span class=\"token punctuation\">.<\/span>delay <span class=\"token operator\">=<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u6700\u540e\uff0c\u6211\u4eec\u5728<br \/>\n    <code><br \/>\n     360<br \/>\n    <\/code><br \/>\n    \u5904\u6dfb\u52a0\u4e00\u4e2a<br \/>\n    <strong><br \/>\n     Moment<br \/>\n    <\/strong><br \/>\n    \uff0c\u4f7f\u7528\u53e6\u4e00\u4e2a\u65b0\u811a\u672c<br \/>\n    <code><br \/>\n     scr_Phase03_360<br \/>\n    <\/code><br \/>\n    \uff0c\u5728\u90a3\u91cc\u6211\u4eec\u964d\u4f4e\u62a4\u76fe\u5e76\u5c06\u67aa\u7684\u5c04\u51fb\u901f\u7387\u6062\u590d\u6b63\u5e38\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\">shieldUpper<span class=\"token punctuation\">.<\/span>isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\nshieldLower<span class=\"token punctuation\">.<\/span>isShielding <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> \ngun<span class=\"token punctuation\">.<\/span>delay <span class=\"token operator\">=<\/span> <span class=\"token number\">45<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u9700\u8981\u6dfb\u52a0\u4ece\u7b2c\u4e8c\u9636\u6bb5\u5230\u6700\u540e\u9636\u6bb5\u7684\u5207\u6362\u3002\u91cd\u65b0\u6253\u5f00<br \/>\n    <code><br \/>\n     scr_Boss_Step<br \/>\n    <\/code><br \/>\n    \uff0c\u5e76\u5728\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_LaserCannon<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token operator\">!<\/span>isPhase_03<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    timeline_index <span class=\"token operator\">=<\/span> tm_Boss_Phase03<span class=\"token punctuation\">;<\/span>\n    timeline_position <span class=\"token operator\">=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\n    isPhase_03 <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5\u6fc0\u5149\u70ae\u662f\u5426\u88ab\u6467\u6bc1\uff0c\u4ee5\u53ca\u6211\u4eec\u662f\u5426\u5e94\u8be5\u5904\u4e8e\u6700\u540e\u9636\u6bb5\u3002\u5982\u679c\u662f\uff0c\u6211\u4eec\u9700\u8981\u505a\u7684\u5c31\u662f\u5207\u6362<br \/>\n   <code><br \/>\n    timeline<br \/>\n   <\/code><br \/>\n   \uff0c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f00\u59cb\uff0c\u5e76\u8bbe\u7f6e\u4e3a\u6700\u540e\u9636\u6bb5\u3002\n  <\/p>\n<ol>\n<li>\n    \u73b0\u5728\u6211\u4eec\u53ea\u9700\u8981\u4e00\u4e2a\u80dc\u5229\u6761\u4ef6\uff0c\u6211\u4eec\u5c06\u628a\u5b83\u6dfb\u52a0\u5230\u540c\u4e00\u4e2a\u811a\u672c\u4e2d\u3002\u5728<br \/>\n    <code><br \/>\n     scr_Boss_Step<br \/>\n    <\/code><br \/>\n    \u7684\u672b\u5c3e\u5199\u4e0a\u6700\u540e\u7684\u6761\u4ef6\u8bed\u53e5\uff1a\n   <\/li>\n<\/ol>\n<pre><code class=\"prism language-js\"><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">instance_exists<\/span><span class=\"token punctuation\">(<\/span>obj_BossCore<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token operator\">!<\/span>isBossDefeated<span class=\"token punctuation\">)<\/span>\n<span class=\"token punctuation\">{<!-- --><\/span>\n    timeline_running <span class=\"token operator\">=<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">with<\/span> <span class=\"token punctuation\">(<\/span>gun<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<!-- --><\/span> <span class=\"token function\">instance_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span>\n    isBossDefeated <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span>\n<\/code><\/pre>\n<p>\n   \u6211\u4eec\u68c0\u67e5 Boss \u6838\u5fc3\u662f\u5426\u88ab\u6467\u6bc1\uff0c\u4ee5\u53ca\u662f\u5426\u5df2\u8c03\u7528\u80dc\u5229\u6761\u4ef6\u3002\u5982\u679c Boss \u88ab\u6253\u8d25\uff0c\u6211\u4eec\u505c\u6b62\u65f6\u95f4\u8f74\u5e76\u5ba3\u5e03\u5931\u8d25\u3002\n  <\/p>\n<ol>\n<li>\n    \u8fd0\u884c\u6e38\u620f\u3002\u8fd9\u4f1a\u82b1\u8d39\u4e00\u4e9b\u65f6\u95f4\uff0c\u4f46\u524d\u4e24\u4e2a\u9636\u6bb5\u5e94\u8be5\u4e0e\u4ee5\u524d\u4e00\u6837\uff0c\u4e00\u65e6\u6fc0\u5149\u70ae\u88ab\u6467\u6bc1\uff0c\u6700\u540e\u4e00\u4e2a\u9636\u6bb5\u5c31\u4f1a\u6fc0\u6d3b\u3002\u62a4\u76fe\u5e94\u8be5\u4f1a\u6253\u5f00\uff0c\u67aa\u4f1a\u5c04\u51fa\u4e00\u8fde\u4e32\u7684\u5b50\u5f39\u3002\u7136\u540e\u5e94\u8be5\u4f1a\u6709\u4e00\u4e2a\u5b89\u9759\u7684\u65f6\u523b\uff0c\u73a9\u5bb6\u53ef\u4ee5\u653b\u51fb Boss \u6838\u5fc3\u3002\u51e0\u79d2\u949f\u540e\uff0c\u67aa\u5e94\u8be5\u5f00\u59cb\u5c04\u51fb\uff0c\u62a4\u76fe\u4f1a\u5173\u95ed\u3002\u8fd9\u5c06\u91cd\u590d\uff0c\u76f4\u5230\u73a9\u5bb6\u51fb\u8d25 Boss\u3002\u8fd9\u4e2a\u9636\u6bb5\u5e94\u8be5\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u7684\u622a\u56fe\uff1a\n   <\/li>\n<\/ol>\n<h2>\n   <a id=\"_2335\"><br \/>\n   <\/a><br \/>\n   \u7ed3\u675f<br \/>\n  <\/h2>\n<p>\n   \u6211\u4eec\u6b63\u5728\u7ed3\u675f\u8fd9\u4e00\u7ae0\uff0c\u8fd8\u6709\u4e00\u4e9b\u672a\u5b8c\u6210\u7684\u5143\u7d20\uff0c\u4f46\u4f60\u5df2\u7ecf\u6709\u80fd\u529b\u81ea\u5df1\u5b8c\u6210\u3002\u4ecd\u7136\u6709\u6240\u6709\u7684\u58f0\u97f3\u3001\u80cc\u666f\u827a\u672f\u548c\u524d\u7aef\u8981\u6784\u5efa\u3002\u4e0d\u4ec5\u5982\u6b64\uff0c\u4f60\u53ef\u80fd\u5df2\u7ecf\u6ce8\u610f\u5230\u73a9\u5bb6\u65e0\u6cd5\u88ab\u6740\u6b7b\u3002\u8ba9\u73a9\u5bb6\u65e0\u654c\u4f7f\u6211\u4eec\u66f4\u5bb9\u6613\u6d4b\u8bd5 Boss \u6218\u6597\uff0c\u6240\u4ee5\u5728\u6dfb\u52a0\u540e\u518d\u8bd5\u4e00\u6b21\u6218\u6597\u3002Boss \u6218\u6597\u975e\u5e38\u56f0\u96be\uff0c\u4f46\u4e5f\u5f88\u5bb9\u6613\u6539\u53d8\u3002\u4e3a\u4ec0\u4e48\u4e0d\u5c1d\u8bd5\u6539\u53d8\u6bcf\u4e2a\u9636\u6bb5\u7684\u65f6\u95f4\u6216\u5c1d\u8bd5\u8c03\u6574\u4f24\u5bb3\u7684\u503c\u3002\u4e3a\u4e86\u66f4\u8fdb\u4e00\u6b65\uff0c\u4f60\u53ef\u4ee5\u6784\u5efa\u5bfc\u81f4\u6218\u6597\u7684\u5173\u5361\u548c\u654c\u4eba\u3002\u73a9\u5f97\u5f00\u5fc3\uff0c\u5b83\u53ef\u80fd\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u7684\u622a\u56fe\uff01\n  <\/p>\n<\/p>\n<h2>\n   <a id=\"_2341\"><br \/>\n   <\/a><br \/>\n   \u603b\u7ed3<br \/>\n  <\/h2>\n<p>\n   \u606d\u559c\uff0c\u4f60\u521a\u521a\u5efa\u7acb\u4e86\u4e00\u573a\u53f2\u8bd7\u822c\u7684 Boss \u6218\uff01\u6211\u4eec\u4ece\u63a2\u8ba8\u7cfb\u7edf\u8bbe\u8ba1\u548c\u521b\u5efa\u4e00\u4e9b\u975e\u5e38\u6709\u7528\u7684\u811a\u672c\u5f00\u59cb\u8fd9\u4e00\u7ae0\u3002\u6211\u4eec\u5efa\u7acb\u4e86\u4e00\u4e2a\u52a8\u753b\u7cfb\u7edf\uff0c\u6e38\u620f\u4e2d\u7684\u5927\u591a\u6570\u5bf9\u8c61\u90fd\u4f7f\u7528\u4e86\u5b83\u3002\u6211\u4eec\u5b66\u4f1a\u4e86\u9884\u6d4b\u78b0\u649e\u5e76\u5728\u73a9\u5bb6\u8eab\u4e0a\u5e94\u7528\u6211\u4eec\u81ea\u5df1\u7684\u81ea\u5b9a\u4e49\u91cd\u529b\u3002\u6211\u4eec\u751a\u81f3\u521b\u5efa\u4e86\u73a9\u5bb6\u53ef\u4ee5\u8df3\u8dc3\u548c\u7740\u9646\u7684\u5e73\u53f0\u3002\u6211\u4eec\u4ecb\u7ecd\u4e86\u5e38\u91cf\uff0c\u8fd9\u4f7f\u5f97\u4ee3\u7801\u5bf9\u6211\u4eec\u6765\u8bf4\u66f4\u5bb9\u6613\u9605\u8bfb\uff0c\u5bf9\u8ba1\u7b97\u673a\u66f4\u6709\u6548\u3002\u7136\u540e\uff0c\u6211\u4eec\u7ee7\u7eed\u6784\u5efa\u4e86\u4e00\u4e2a\u5229\u7528\u6211\u4eec\u4e4b\u524d\u7684\u77e5\u8bc6\u548c\u65b0\u7cfb\u7edf\u7684\u4e09\u9636\u6bb5 Boss \u6218\u6597\u3002\n  <\/p>\n<p>\n   \u5728\u4e0b\u4e00\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u5f00\u59cb\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8e\u7269\u7406\u7684\u6e38\u620f\uff0c\u5229\u7528 GameMaker: Studio \u7684 Box2D \u5b9e\u73b0\u3002\u8fd9\u5c06\u4f7f\u7528\u5b8c\u5168\u4e0d\u540c\u7684\u78b0\u649e\u68c0\u6d4b\u548c\u7269\u7406\u7cfb\u7edf\u7684\u65b9\u6cd5\u3002\u8fd9\u4e5f\u5c06\u5141\u8bb8\u6211\u4eec\u62e5\u6709\u5bf9\u4e16\u754c\u505a\u51fa\u53cd\u5e94\u7684\u5bf9\u8c61\uff0c\u51e0\u4e4e\u4e0d\u9700\u8981\u7f16\u5199\u4ee3\u7801\uff01\n  <\/p>\n<\/p><\/div>\n<link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/markdown_views-a5d25dd831.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/style-e504d6a974.css\" rel=\"stylesheet\"\/>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\uff1a zh.annas-archive.org\/md5\/B91F6649162E9805B55AF1CE82 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-1193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-25"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-\u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"\u539f\u6587\uff1a zh.annas-archive.org\/md5\/B91F6649162E9805B55AF1CE82 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-\u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-22T22:00:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@wunen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin@wunen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\",\"datePublished\":\"2025-04-22T22:00:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/\"},\"wordCount\":366,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u52a8\u4f5c\u5192\u9669\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/\",\"url\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/\",\"name\":\"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-04-22T22:00:09+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"width\":260,\"height\":180},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.wunen.com\/#website\",\"url\":\"http:\/\/www.wunen.com\/\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"description\":\"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9\",\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.wunen.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/www.wunen.com\/#organization\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"url\":\"http:\/\/www.wunen.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"width\":1024,\"height\":1024,\"caption\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\",\"name\":\"admin@wunen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"caption\":\"admin@wunen\"},\"sameAs\":[\"http:\/\/www.wunen.com\"],\"url\":\"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-\u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\/","og_locale":"zh_CN","og_type":"article","og_title":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"\u539f\u6587\uff1a zh.annas-archive.org\/md5\/B91F6649162E9805B55AF1CE82 [&hellip;]","og_url":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-\u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-04-22T22:00:09+00:00","og_image":[{"width":260,"height":180,"url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","type":"image\/jpeg"}],"author":"admin@wunen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin@wunen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"19 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#article","isPartOf":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/"},"author":{"name":"admin@wunen","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09","datePublished":"2025-04-22T22:00:09+00:00","mainEntityOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/"},"wordCount":366,"commentCount":0,"publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u52a8\u4f5c\u5192\u9669"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/","url":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/","name":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"http:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-04-22T22:00:09+00:00","breadcrumb":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#primaryimage","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","width":260,"height":180},{"@type":"BreadcrumbList","@id":"http:\/\/www.wunen.com\/index.php\/2025\/04\/23\/gamemaker-html5-%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%ef%bc%88%e4%ba%8c%ef%bc%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"GameMaker HTML5 \u6e38\u620f\u5f00\u53d1\uff08\u4e8c\uff09"}]},{"@type":"WebSite","@id":"http:\/\/www.wunen.com\/#website","url":"http:\/\/www.wunen.com\/","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","description":"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9","publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.wunen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"http:\/\/www.wunen.com\/#organization","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","url":"http:\/\/www.wunen.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","width":1024,"height":1024,"caption":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51"},"image":{"@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8","name":"admin@wunen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","caption":"admin@wunen"},"sameAs":["http:\/\/www.wunen.com"],"url":"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/"}]}},"_links":{"self":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/1193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/comments?post=1193"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/1193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media?parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}