{"id":1819,"date":"2025-05-06T06:00:23","date_gmt":"2025-05-05T22:00:23","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/"},"modified":"2025-05-06T06:00:23","modified_gmt":"2025-05-05T22:00:23","slug":"python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/","title":{"rendered":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60"},"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-atom-one-dark\" 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<p>\n   14-2\u5c04\u51fb\u6e38\u620f \uff1a\u521b\u5efa\u4e00\u4e2a\u77e9\u5f62\uff0c\u5b83\u5728\u5c4f\u5e55\u53f3\u8fb9\u7f18\u4ee5\u56fa\u5b9a\u7684\u901f\u5ea6\u4e0a\u4e0b\u79fb\u52a8\u3002\u7136\u540e\uff0c\u5728\u5c4f\u5e55\u5de6\u8fb9\u7f18\u521b\u5efa\u4e00\u8258\u98de\u8239\uff0c\u73a9\u5bb6\u53ef\u4e0a\u4e0b\u79fb\u52a8\u8be5\u98de\u8239\uff0c\u5e76\u5c04\u51fb\u524d\u8ff0\u77e9\u5f62\u76ee\u6807\u3002\u6dfb\u52a0\u4e00 \u4e2a\u7528\u4e8e\u5f00\u59cb\u6e38\u620f\u7684Play\u6309\u94ae\uff0c\u5728\u73a9\u5bb6\u4e09\u6b21\u672a\u51fb\u4e2d\u76ee\u6807\u65f6\u7ed3\u675f\u6e38\u620f\uff0c\u5e76\u91cd\u65b0\u663e\u793aPlay\u6309\u94ae\uff0c\u8ba9\u73a9\u5bb6\u80fd\u591f\u901a\u8fc7\u5355\u51fb\u8be5\u6309\u94ae\u6765\u91cd\u65b0\u5f00\u59cb\u6e38\u620f\u3002\n  <\/p>\n<pre><code class=\"prism language-python\"><span class=\"token comment\">#learn_game.py<\/span>\n<span class=\"token comment\">#coding=utf-8<\/span>\n<span class=\"token keyword\">import<\/span> pygame\n\n<span class=\"token keyword\">from<\/span> pygame<span class=\"token punctuation\">.<\/span>sprite <span class=\"token keyword\">import<\/span> Group\n<span class=\"token keyword\">from<\/span> settings <span class=\"token keyword\">import<\/span> Settings\n<span class=\"token keyword\">from<\/span> rocket <span class=\"token keyword\">import<\/span> Rocket\n<span class=\"token keyword\">from<\/span> cube <span class=\"token keyword\">import<\/span> Cube\n<span class=\"token keyword\">from<\/span> game_stats <span class=\"token keyword\">import<\/span> GameStats\n<span class=\"token keyword\">from<\/span> button <span class=\"token keyword\">import<\/span> Button\n<span class=\"token keyword\">import<\/span> game_functions <span class=\"token keyword\">as<\/span> gf\n\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">run_game<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n\t<span class=\"token comment\"># \u521d\u59cb\u5316\u6e38\u620f\u5e76\u521b\u5efa\u5c4f\u5e55\u5bf9\u8c61<\/span>\n\tpygame<span class=\"token punctuation\">.<\/span>init<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\tai_settings <span class=\"token operator\">=<\/span> Settings<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\tscreen <span class=\"token operator\">=<\/span> pygame<span class=\"token punctuation\">.<\/span>display<span class=\"token punctuation\">.<\/span>set_mode<span class=\"token punctuation\">(<\/span>\n\t\t<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">.<\/span>screen_width<span class=\"token punctuation\">,<\/span> ai_settings<span class=\"token punctuation\">.<\/span>screen_height<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\n\tpygame<span class=\"token punctuation\">.<\/span>display<span class=\"token punctuation\">.<\/span>set_caption<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Rocket Game\"<\/span><span class=\"token punctuation\">)<\/span>\n\t\n\t<span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2aplay\u6309\u94ae<\/span>\n\tplay_button <span class=\"token operator\">=<\/span> Button<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">,<\/span> <span class=\"token string\">\"Play\"<\/span><span class=\"token punctuation\">)<\/span>\n\t<span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u5b58\u50a8\u6e38\u620f\u7edf\u8ba1\u4fe1\u606f\u7684\u5b9e\u4f8b<\/span>\n\tstats <span class=\"token operator\">=<\/span> GameStats<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">)<\/span>\n\t\n\t<span class=\"token comment\"># \u8bbe\u7f6ebackground\u989c\u8272\u84dd\u8272<\/span>\n\t<span class=\"token comment\">#bg_color = (135,206,250)<\/span>\n\t\n\t<span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u706b\u7bad<\/span>\n\trocket <span class=\"token operator\">=<\/span> Rocket<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">)<\/span>\n\t\n\t<span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u77e9\u5f62<\/span>\n\t<span class=\"token comment\">#cube = Cube(ai_settings, screen)<\/span>\n\t\n\t<span class=\"token comment\">#\u521b\u5efa\u4e00\u4e2a\u5b58\u50a8\u70ae\u706b\u7684\u7f16\u7ec4<\/span>\n\tfires <span class=\"token operator\">=<\/span> Group<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\t\n\t<span class=\"token comment\">#\u521b\u5efa\u77e9\u5f62\u7f16\u7ec4<\/span>\n\tcubes <span class=\"token operator\">=<\/span> Group<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\t\n\t<span class=\"token comment\">#\u5f00\u59cb\u6e38\u620f\u7684\u4e3b\u5faa\u73af<\/span>\n\t<span class=\"token keyword\">while<\/span> <span class=\"token boolean\">True<\/span><span class=\"token punctuation\">:<\/span>\n\t\t<span class=\"token comment\">#\u76d1\u63a7\u952e\u76d8\u548c\u9f20\u6807\u4e8b\u4ef6<\/span>\n\t\tgf<span class=\"token punctuation\">.<\/span>check_events<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">,<\/span> stats<span class=\"token punctuation\">,<\/span> play_button<span class=\"token punctuation\">,<\/span> rocket<span class=\"token punctuation\">,<\/span>\n\t\t\tfires<span class=\"token punctuation\">,<\/span> cubes<span class=\"token punctuation\">)<\/span>\n\t\t\n\t\t<span class=\"token comment\">#\u706b\u7bad\u4f4d\u7f6e<\/span>\n\t\trocket<span class=\"token punctuation\">.<\/span>update<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\t\t\n\t\t<span class=\"token comment\">#\u70ae\u706b\u4f4d\u7f6e<\/span>\n\t\tgf<span class=\"token punctuation\">.<\/span>update_fires<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">,<\/span> stats<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">,<\/span> rocket<span class=\"token punctuation\">,<\/span> fires<span class=\"token punctuation\">,<\/span> cubes<span class=\"token punctuation\">)<\/span>\n\t\t\n\t\t<span class=\"token comment\">#\u77e9\u5f62\u4f4d\u7f6e<\/span>\n\t\tcubes<span class=\"token punctuation\">.<\/span>update<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n\t\t\n\t\t\n\t\t<span class=\"token comment\">#\u6bcf\u6b21\u5faa\u73af\u65f6\u90fd\u91cd\u7ed8\u5c4f\u5e55<\/span>\n\t\tgf<span class=\"token punctuation\">.<\/span>update_screen<span class=\"token punctuation\">(<\/span>ai_settings<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">,<\/span> stats<span class=\"token punctuation\">,<\/span> rocket<span class=\"token punctuation\">,<\/span> fires<span class=\"token punctuation\">,<\/span> cubes<span class=\"token punctuation\">,<\/span>\n\t\t\tplay_button<span class=\"token punctuation\">)<\/span>\n\t\t\n\nrun_game<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<pre><code class=\"prism language-python\"><span class=\"token comment\">#settings.py<\/span>\n<span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Settings<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n\t<span class=\"token keyword\">def<\/span> <span class=\"token function\">__init__<\/span><span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n\t\t<span class=\"token comment\">#\u521d\u59cb\u5316\u6e38\u620f\u7684\u8bbe\u7f6e<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>screen_width <span class=\"token operator\">=<\/span> <span class=\"token number\">1200<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>screen_height <span class=\"token operator\">=<\/span> <span class=\"token number\">800<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>bg_color <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">230<\/span><span class=\"token punctuation\">,<\/span><span class=\"token number\">230<\/span><span class=\"token punctuation\">,<\/span><span class=\"token number\">230<\/span><span class=\"token punctuation\">)<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>rocket_speed <span class=\"token operator\">=<\/span> <span class=\"token number\">1.5<\/span>\n\n\t\t<span class=\"token comment\">#\u98de\u8239\u7684\u8bbe\u7f6e<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>ship_speed_factor <span class=\"token operator\">=<\/span> <span class=\"token number\">1.5<\/span>\n\t\t\n\t\t<span class=\"token comment\">#\u70ae\u706b\u7684\u8bbe\u7f6e<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_speed_factor <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_width <span class=\"token operator\">=<\/span> <span class=\"token number\">15<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_height <span class=\"token operator\">=<\/span> <span class=\"token number\">3<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_color <span class=\"token operator\">=<\/span> <span class=\"token number\">255<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">140<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_allowed <span class=\"token operator\">=<\/span> <span class=\"token number\">5<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fire_limit <span class=\"token operator\">=<\/span> <span class=\"token number\">3<\/span>\n\n\t\t<span class=\"token comment\">#\u65b9\u5757\u7684\u8bbe\u7f6e<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>cube_width <span class=\"token operator\">=<\/span> <span class=\"token number\">50<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>cube_height <span class=\"token operator\">=<\/span> <span class=\"token number\">50<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>cube_color <span class=\"token operator\">=<\/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\">230<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>cube_speed_factor <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span>\n\t\t\n\t\t<span class=\"token comment\">#\u4e3a1\u4ee3\u8868\u5411\u4e0b\u79fb\uff0c\u4e3a-1\u8868\u793a\u5411\u4e0a\u79fb<\/span>\n\t\tself<span class=\"token punctuation\">.<\/span>fleet_direction <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span>\n\n<\/code><\/pre>\n<pre><code class=\"prism language-python\"><span class=\"token comment\">#game_functions.py<\/span>\n<span class=\"token comment\">#coding=utf-8<\/span>\n<span class=\"token keyword\">import<\/span> sys\n<span class=\"token keyword\">import<\/span> pygame\n<span class=\"token keyword\">from<\/span> fire <span class=\"token keyword\">import<\/span> Fire\n<span class=\"token keyword\">from<\/span> cube <span class=\"token keyword\">import<\/span> Cube\n<span class=\"token keyword\">from<\/span> time <span class=\"token keyword\">import<\/span> sleep\n\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">check_keydown_events<\/span><span class=\"token punctuation\">(<\/span>event<span class=\"token punctuation\">,<\/span> ai_settings<span class=\"token punctuation\">,<\/span> screen<span class=\"token punctuation\">,<\/span> rocket<span class=\"token punctuation\">,<\/span> fires<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n\t<span class=\"token comment\">#\u6309\u952e\u54cd\u5e94<\/span>\n<span class=\"token comment\">#\tif event.key == pygame.K_RIGHT:<\/span>\n<span class=\"token comment\">#\t\trocket.moving_right = True<\/span>\n<span class=\"token comment\">#\telif event.key == pygame.K_LEFT:<\/span>\n<span class=\"token comment\">#\t\trocket.moving_left = True<\/span>\n\t<span class=\"token keyword\">if<\/span> event<span class=\"token punctuation\">.<\/span>key <span class=\"token operator\">==<\/span> pygame<span class=\"token punctuation\">.<\/span>K_UP<span class=\"token punctuation\">:<\/span>\n\t\trocket<span class=\"token punctuation\">.<\/span>moving_up <span class=\"token operator\">=<\/span> <\/code><\/pre>\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>14-2\u5c04\u51fb\u6e38\u620f \uff1a\u521b\u5efa\u4e00\u4e2a\u77e9\u5f62\uff0c\u5b83\u5728\u5c4f\u5e55\u53f3\u8fb9\u7f18\u4ee5\u56fa\u5b9a\u7684\u901f\u5ea6\u4e0a\u4e0b\u79fb\u52a8\u3002\u7136\u540e\uff0c\u5728\u5c4f\u5e55\u5de6\u8fb9\u7f18\u521b\u5efa\u4e00\u8258\u98de\u8239\uff0c\u73a9\u5bb6\u53ef\u4e0a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \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\/05\/06\/python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f-14-2\u7ec3\u4e60\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"14-2\u5c04\u51fb\u6e38\u620f \uff1a\u521b\u5efa\u4e00\u4e2a\u77e9\u5f62\uff0c\u5b83\u5728\u5c4f\u5e55\u53f3\u8fb9\u7f18\u4ee5\u56fa\u5b9a\u7684\u901f\u5ea6\u4e0a\u4e0b\u79fb\u52a8\u3002\u7136\u540e\uff0c\u5728\u5c4f\u5e55\u5de6\u8fb9\u7f18\u521b\u5efa\u4e00\u8258\u98de\u8239\uff0c\u73a9\u5bb6\u53ef\u4e0a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f-14-2\u7ec3\u4e60\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-05T22:00:23+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=\"1 \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\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60\",\"datePublished\":\"2025-05-05T22:00:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/\"},\"wordCount\":6,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u5c04\u51fb\u6e38\u620f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/\",\"url\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/\",\"name\":\"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-05-05T22:00:23+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#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\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60\"}]},{\"@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":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \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\/05\/06\/python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f-14-2\u7ec3\u4e60\/","og_locale":"zh_CN","og_type":"article","og_title":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"14-2\u5c04\u51fb\u6e38\u620f \uff1a\u521b\u5efa\u4e00\u4e2a\u77e9\u5f62\uff0c\u5b83\u5728\u5c4f\u5e55\u53f3\u8fb9\u7f18\u4ee5\u56fa\u5b9a\u7684\u901f\u5ea6\u4e0a\u4e0b\u79fb\u52a8\u3002\u7136\u540e\uff0c\u5728\u5c4f\u5e55\u5de6\u8fb9\u7f18\u521b\u5efa\u4e00\u8258\u98de\u8239\uff0c\u73a9\u5bb6\u53ef\u4e0a [&hellip;]","og_url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f-14-2\u7ec3\u4e60\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-05-05T22:00:23+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":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#article","isPartOf":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/"},"author":{"name":"admin@wunen","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60","datePublished":"2025-05-05T22:00:23+00:00","mainEntityOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/"},"wordCount":6,"commentCount":0,"publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u5c04\u51fb\u6e38\u620f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/","url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/","name":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"http:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-05-05T22:00:23+00:00","breadcrumb":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#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\/05\/06\/python%e4%b9%8bpygame%e7%9a%84%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f-14-2%e7%bb%83%e4%b9%a0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"python\u4e4bpygame\u7684\u5c04\u51fb\u6e38\u620f 14-2\u7ec3\u4e60"}]},{"@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\/1819","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=1819"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/1819\/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=1819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=1819"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=1819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}