{
  "version": "https://jsonfeed.org/version/1", 
  "title": "PyGame", 
  "description": "\u7528\u4e8e\u6e38\u620f\u5f00\u53d1\u7684 Python \u7f16\u7a0b\u6846\u67b6", 
  "home_page_url": "https://www.v2ex.com/go/pygame", 
  "feed_url": "https://www.v2ex.com/feed/pygame.json", 
  "icon": "https://cdn.v2ex.com/navatar/731c/83db/1080_large.png?m=1597190881", 
  "favicon": "https://cdn.v2ex.com/navatar/731c/83db/1080_normal.png?m=1597190881", 
  "items": [
    {
      "author": {
        "url": "https://www.v2ex.com/member/DannyDeng", 
        "name": "DannyDeng", 
        "avatar": "https://cdn.v2ex.com/avatar/751a/939a/425649_large.png?m=1561864151"
      }, 
      "url": "https://www.v2ex.com/t/578672", 
      "date_modified": "2020-08-12T00:08:15+00:00", 
      "content_html": "\u5b66\u4e60 Python\uff0c\u4f7f\u7528\u300a Python \u7f16\u7a0b\uff1a\u4ece\u2f0a\u95e8\u5230\u5b9e\u8df5\u300b\uff0c\u5916\u661f\u4eba\u5165\u4fb5\u7684\u4e3b\u7a0b\u5e8f <a target=\"_blank\" href=\"http://alien_invasion.py\" rel=\"nofollow\">alien_invasion.py</a> \u8fd0\u884c\u540e\uff0c\u53ea\u80fd\u51fa\u73b0\u4e00\u4e2a\u7a7a\u767d\u7a97\u53e3\uff0c\u800c\u4e0d\u80fd\u51fa\u73b0\u7a0b\u5e8f\u9884\u8bbe\u7684\u98de\u673a\u7b49\u5176\u4ed6\u4efb\u4f55\u4e1c\u897f\u3002\u975e\u5e38\u8ff7\u60d1\uff0c\u6073\u8bf7\u9ad8\u4eba\u6307\u70b9\u4e00\u4e0b\uff0c\u611f\u8c22\uff01\u611f\u8c22\uff01<br /><br />\u4e3b\u7a0b\u5e8f\u5982\u4e0b\uff1a<br />import pygame<br />from pygame.sprite import Group<br /><br />from settings import Settings<br />from game_stats import GameStats<br />from scoreboard import Scoreboard<br />from button import Button<br />from ship import Ship<br />import game_functions as gf<br /><br />def run_game():<br />    # Initialize pygame, settings, and screen object.<br />    pygame.init()<br />    ai_settings = Settings()<br />    screen = pygame.display.set_mode(<br />        (ai_settings.screen_width, ai_settings.screen_height))<br />    pygame.display.set_caption(\"Alien Invasion\")<br />    <br />    # Make the Play button.<br />    play_button = Button(ai_settings, screen, \"Play\")<br />    <br />    # Create an instance to store game statistics, and a scoreboard.<br />    stats = GameStats(ai_settings)<br />    sb = Scoreboard(ai_settings, screen, stats)<br />    <br />    # Set the background color.<br />    bg_color = (230, 230, 230)<br />    <br />    # Make a ship, a group of bullets, and a group of aliens.<br />    ship = Ship(ai_settings, screen)<br />    bullets = Group()<br />    aliens = Group()<br />    <br />    # Create the fleet of aliens.<br />    gf.create_fleet(ai_settings, screen, ship, aliens)<br /><br />    # Start the main loop for the game.<br />    while True:<br />        gf.check_events(ai_settings, screen, stats, sb, play_button, ship,<br />            aliens, bullets)<br />        <br />        if stats.game_active:<br />            ship.update()<br />            gf.update_bullets(ai_settings, screen, stats, sb, ship, aliens,<br />                bullets)<br />            gf.update_aliens(ai_settings, screen, stats, sb, ship, aliens,<br />                bullets)<br />        <br />        gf.update_screen(ai_settings, screen, stats, sb, ship, aliens,<br />            bullets, play_button)<br /><br />run_game()", 
      "date_published": "2019-06-30T03:10:11+00:00", 
      "title": "\u6c42\u6559 PYGAME \u7684\u95ee\u9898", 
      "id": "https://www.v2ex.com/t/578672"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/Ratdis", 
        "name": "Ratdis", 
        "avatar": "https://cdn.v2ex.com/gravatar/818290b33f54de58f16bf76d4b0088b8?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/465767", 
      "date_modified": "2020-08-12T00:08:43+00:00", 
      "content_html": "<p>\u4ee3\u7801\u5982\u4e0b\u56fe emmmm</p>\n<p><img alt=\"\u5c4f\u5e55\u5feb\u7167 2018-06-25 \u4e0b\u5348 7.55.24.png\" src=\"https://i.loli.net/2018/06/25/5b30d8c8a1062.png\"></p>\n", 
      "date_published": "2018-06-25T12:01:04+00:00", 
      "title": "\u521d\u5b66 pygame \u5173\u4e8e Mac \u4e0a\u7684 fclock.tick(fps)\u6ca1\u6709\u6548\u679c", 
      "id": "https://www.v2ex.com/t/465767"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/zfree", 
        "name": "zfree", 
        "avatar": "https://cdn.v2ex.com/avatar/dbc9/7b12/44710_large.png?m=1718548127"
      }, 
      "url": "https://www.v2ex.com/t/82475", 
      "date_modified": "2020-08-12T00:08:29+00:00", 
      "content_html": "\u672c\u6765\u4ee5\u4e3a\u795e\u5668brew install pygame\u5c31ok\uff0c\u8c01\u77e5\u9053\u4e0d\u662f\u8fd9\u4e48\u56de\u4e8b\u513f\uff0c\u6298\u817e\u5982\u4e0b<br /><br />\u4e00\u3001\u9996\u5148\u8981\u88c5pip\uff08\u8fd9\u4e2aosx\u6ca1\u6709\uff0cbrew\u4e5f\u6ca1\u627e\u5230\uff09<br />1\u3001\u4e0b\u8f7dhttps://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py<br />     sudo python ez_setup.py<br />2\u3001\u4e0b\u8f7dhttps://raw.github.com/pypa/pip/master/contrib/get-pip.py<br />     sudo python get-pip.py<br /><br />\u4e8c\u3001\u518d\u88c5pygame<br />1\u3001\u4e0b\u8f7dXquartz\u53bb\u5b89\u88c5<br />2\u3001brew install mercurial<br />3\u3001sudo pip install nose<br />4\u3001brew install gfortran<br />5\u3001brew tap homebrew/headonly<br />6\u3001brew install --HEAD smpeg\uff08\u7f16\u8bd1\u5de8\u6162\uff09<br />7\u3001brew install sdl sdl_mixer sdl_image  sdl_ttf portmidi<br />8\u3001sudo pip install hg+http://bitbucket.org/pygame/pygame<br /><br />\u4e09\u3001\u6d4b\u8bd5<br />1\u3001phthon<br />2\u3001import pygame\uff08\u5982\u679c\u6ca1\u6709\u4ec0\u4e48\u4fe1\u606fshow\u51fa\u6765\uff0c\u606d\u559c\u6210\u529f\u4e86\uff01\uff09<br /><br />\u73af\u5883\uff1aosx 10.8.4\uff0cpython2.7.2\u3002\u6211\u60f310.8.x\u5e94\u8be5\u90fd\u53ef\u4ee5\u7684", 
      "date_published": "2013-09-14T14:16:29+00:00", 
      "title": "NND\u7684\uff0cOSX\u88c5\u4e2apygame\u5c31\u8ddf\u4fbf\u79d8\u4e00\u6837\uff0c\u6298\u817e\u534a\u5929\u624d\u641e\u5b9a", 
      "id": "https://www.v2ex.com/t/82475"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/byron", 
        "name": "byron", 
        "avatar": "https://cdn.v2ex.com/avatar/674b/fc5f/1343_large.png?m=1773542326"
      }, 
      "url": "https://www.v2ex.com/t/75878", 
      "date_modified": "2020-08-12T00:08:52+00:00", 
      "content_html": "import pygame\u51fa\u9519\uff1a<br /><br />&gt;&gt;&gt; import pygame<br />Traceback (most recent call last):<br /> File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;<br /> File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py\", line 95, in &lt;module&gt;<br /> from pygame.base import *<br />ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. Did find:<br />\t/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper<br /><br />\u6298\u817e\u4e86\u597d\u4e45\uff0c\u65e0\u89e3\uff0c\u6c42\u52a9\u3002", 
      "date_published": "2013-07-15T12:15:58+00:00", 
      "title": "mac 10.8.4 \u5b89\u88c5pygame\u5931\u8d25", 
      "id": "https://www.v2ex.com/t/75878"
    }
  ]
}