PyGame way to explore https:https://cdn.v2ex.com/navatar/731c/83db/1080_normal.png?m=1597190881 https:https://cdn.v2ex.com/navatar/731c/83db/1080_large.png?m=1597190881 2019-06-29T03:10:11Z Copyright © 2010-2018, V2EX 求教 PYGAME 的问题 tag:www.v2ex.com,2019-06-30:/t/578672 2019-06-30T03:10:11Z 2019-06-29T03:10:11Z DannyDeng member/DannyDeng alien_invasion.py 运行后,只能出现一个空白窗口,而不能出现程序预设的飞机等其他任何东西。非常迷惑,恳请高人指点一下,感谢!感谢! 主程序如下: import pygame from pygame.sprite import Group from settings import Settings from game_stats import GameStats from scoreboard import Scoreboard from button import Button from ship import Ship import game_functions as gf def run_game(): # Initialize pygame, settings, and screen object. pygame.init() ai_settings = Settings() screen = pygame.display.set_mode( (ai_settings.screen_width, ai_settings.screen_height)) pygame.display.set_caption("Alien Invasion") # Make the Play button. play_button = Button(ai_settings, screen, "Play") # Create an instance to store game statistics, and a scoreboard. stats = GameStats(ai_settings) sb = Scoreboard(ai_settings, screen, stats) # Set the background color. bg_color = (230, 230, 230) # Make a ship, a group of bullets, and a group of aliens. ship = Ship(ai_settings, screen) bullets = Group() aliens = Group() # Create the fleet of aliens. gf.create_fleet(ai_settings, screen, ship, aliens) # Start the main loop for the game. while True: gf.check_events(ai_settings, screen, stats, sb, play_button, ship, aliens, bullets) if stats.game_active: ship.update() gf.update_bullets(ai_settings, screen, stats, sb, ship, aliens, bullets) gf.update_aliens(ai_settings, screen, stats, sb, ship, aliens, bullets) gf.update_screen(ai_settings, screen, stats, sb, ship, aliens, bullets, play_button) run_game() ]]> 初学 pygame 关于 Mac 上的 fclock.tick(fps)没有效果 tag:www.v2ex.com,2018-06-25:/t/465767 2018-06-25T12:01:04Z 2019-05-17T08:26:28Z Ratdis member/Ratdis 代码如下图 emmmm
]]> NND的,OSX装个pygame就跟便秘一样,折腾半天才搞定 tag:www.v2ex.com,2013-09-14:/t/82475 2013-09-14T14:16:29Z 2017-04-05T18:17:00Z zfree member/zfree 一、首先要装pip(这个osx没有,brew也没找到) 1、下载https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py 2、下载https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python get-pip.py 二、再装pygame 1、下载Xquartz去安装 2、brew install mercurial 3、sudo pip install nose 4、brew install gfortran 5、brew tap homebrew/headonly 6、brew install --HEAD smpeg(编译巨慢) 7、brew install sdl sdl_mixer sdl_image sdl_ttf portmidi 8、sudo pip install hg+http://bitbucket.org/pygame/pygame 三、测试 1、phthon 2、import pygame(如果没有什么信息show出来,恭喜成功了!) 环境:osx 10.8.4,python2.7.2。我想10.8.x应该都可以的 ]]> mac 10.8.4 安装pygame失败 tag:www.v2ex.com,2013-07-15:/t/75878 2013-07-15T12:15:58Z 2013-09-29T06:00:48Z byron member/byron >>> import pygame Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py", line 95, in <module> from pygame.base import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper 折腾了好久,无解,求助。 ]]>
ubao
snddm
index
pchome
yahoo
rakuten
mypaper
meadowduck
bidyahoo
youbao
zxmzxm
asda
bnvcg
cvbfg
dfscv
mmhjk
xxddc
yybgb
zznbn
ccubao
uaitu
acv
GXCV
ET
GDG
YH
FG
BCVB
FJFH
CBRE
CBC
GDG
ET54
WRWR
RWER
WREW
WRWER
RWER
SDG
EW
SF
DSFSF
fbbs
ubao
fhd
dfg
ewr
dg
df
ewwr
ewwr
et
ruyut
utut
dfg
fgd
gdfgt
etg
dfgt
dfgd
ert4
gd
fgg
wr
235
wer3
we
vsdf
sdf
gdf
ert
xcv
sdf
rwer
hfd
dfg
cvb
rwf
afb
dfh
jgh
bmn
lgh
rty
gfds
cxv
xcv
xcs
vdas
fdf
fgd
cv
sdf
tert
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
sdf
shasha9178
shasha9178
shasha9178
shasha9178
shasha9178
liflif2
liflif2
liflif2
liflif2
liflif2
liblib3
liblib3
liblib3
liblib3
liblib3
zhazha444
zhazha444
zhazha444
zhazha444
zhazha444
dende5
dende
denden
denden2
denden21
fenfen9
fenf619
fen619
fenfe9
fe619
sdf
sdf
sdf
sdf
sdf
zhazh90
zhazh0
zhaa50
zha90
zh590
zho
zhoz
zhozh
zhozho
zhozho2
lislis
lls95
lili95
lils5
liss9
sdf0ty987
sdft876
sdft9876
sdf09876
sd0t9876
sdf0ty98
sdf0976
sdf0ty986
sdf0ty96
sdf0t76
sdf0876
df0ty98
sf0t876
sd0ty76
sdy76
sdf76
sdf0t76
sdf0ty9
sdf0ty98
sdf0ty987
sdf0ty98
sdf6676
sdf876
sd876
sd876
sdf6
sdf6
sdf9876
sdf0t
sdf06
sdf0ty9776
sdf0ty9776
sdf0ty76
sdf8876
sdf0t
sd6
sdf06
s688876
sd688
sdf86