免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 18516 | 回复: 23
打印 上一主题 下一主题

初学python写了一个斗地主游戏,py2exe打包成exe [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-10-31 23:18 |只看该作者 |倒序浏览
本帖最后由 ydwydw 于 2013-11-10 22:32 编辑

请指教,windows xp下测试通过 ,wine下也测试通过,不过最近wine更新后显示的位置有点不正确了,不过不影响使用!
2013年11月10日从新打包了下,这回用pyinstaller打包的,感觉比py2exe要好些。修正了一些BUG。
http://pan.baidu.com/s/11PJLp

论坛徽章:
0
2 [报告]
发表于 2013-11-01 15:14 |只看该作者
what do you want?

论坛徽章:
0
3 [报告]
发表于 2013-11-01 22:55 |只看该作者
i want to share it to others and let others enjoy it!
do u try it?

论坛徽章:
0
4 [报告]
发表于 2013-11-02 11:38 |只看该作者
好,我试试。

论坛徽章:
0
5 [报告]
发表于 2013-11-02 12:59 |只看该作者
试了一下很不错啊,是拿pygame写的?
退出的时候会报错
另外右上角那些按钮是不能点的?

1.png (118.82 KB, 下载次数: 101)

1.png

论坛徽章:
0
6 [报告]
发表于 2013-11-02 21:11 |只看该作者
那个是背景图。不是pygame写的,用cocos2d。
linux下速度很快!你可以用wine模拟器玩,不是报错,是日志!一直都没去掉,不影响玩的!

论坛徽章:
0
7 [报告]
发表于 2013-11-03 22:36 |只看该作者
再次膜拜一下。这种需要美工的东西我是想都不敢想)

论坛徽章:
4
天蝎座
日期:2013-11-06 11:39:34巳蛇
日期:2014-01-16 16:53:14午马
日期:2014-08-25 21:42:302015年迎新春徽章
日期:2015-03-03 17:21:44
8 [报告]
发表于 2013-11-04 16:17 |只看该作者
DEBUG:client:Button on_enter run!
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:3
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:4
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:5
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:6
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:7
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:8
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:9
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:10
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:11
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:12
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:13
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:14
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:15
DEBUG:client:card construct has been executed , card num:16
DEBUG:client:card construct has been executed , card num:16
DEBUG:client:card construct has been executed , card num:17
DEBUG:client:card construct has been executed , card num:17
DEBUG:client: startGame how many cards: 54
DEBUG:client:finish card:[13, 5, 11, 13, 9, 4, 14, 15, 9, 6, 12, 15, 9, 5, 5, 7, 7] cards:[13, 5, 11, 13, 9, 4, 14, 15, 9, 6, 12, 15, 9, 5, 5, 7, 7]cards len:17
DEBUG:client:sortSpriteCards :[4, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 14, 15, 15]
DEBUG:client:my card avg score:9.35294117647
DEBUG:client:my name is :Raffeale finishi get card, my cards is:[4, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 14, 15, 15]
DEBUG:client:Robot finish get card!
DEBUG:client:finish card:[<__main__.CardBg object at 0x02F2FF70>, <__main__.CardBg object at 0x02FA8C50>, <__main__.CardBg object at 0x02F99A90>, <__main__.CardBg object at 0x02F99450>, <__main__.CardBg object at 0x02FA8A70>, <__main__.CardBg object at 0x02F2F710>, <__main__.CardBg object at 0x02FA8170>, <__main__.CardBg object at 0x02F2F070>, <__main__.CardBg object at 0x02FB2B10>, <__main__.CardBg object at 0x02F2FA10>, <__main__.CardBg object at 0x02F2F210>, <__main__.CardBg object at 0x02F990B0>, <__main__.CardBg object at 0x02F3A330>, <__main__.CardBg object at 0x02FB2970>, <__main__.CardBg object at 0x02F156D0>, <__main__.CardBg object at 0x02F997B0>, <__main__.CardBg object at 0x02F254B0>] cards:[8, 14, 13, 11, 14, 7, 12, 6, 17, 7, 6, 10, 8, 16, 3, 11, 4]cards len:17
DEBUG:client:sortSpriteCards :[<__main__.CardBg object at 0x02F156D0>, <__main__.CardBg object at 0x02F254B0>, <__main__.CardBg object at 0x02F2F070>, <__main__.CardBg object at 0x02F2F210>, <__main__.CardBg object at 0x02F2F710>, <__main__.CardBg object at 0x02F2FA10>, <__main__.CardBg object at 0x02F2FF70>, <__main__.CardBg object at 0x02F3A330>, <__main__.CardBg object at 0x02F990B0>, <__main__.CardBg object at 0x02F99450>, <__main__.CardBg object at 0x02F997B0>, <__main__.CardBg object at 0x02FA8170>, <__main__.CardBg object at 0x02F99A90>, <__main__.CardBg object at 0x02FA8C50>, <__main__.CardBg object at 0x02FA8A70>, <__main__.CardBg object at 0x02FB2970>, <__main__.CardBg object at 0x02FB2B10>]
DEBUG:client:my card avg score:9.82352941176
DEBUG:client:my name is :RobotPlayer1 finishi get card, my cards is:[3, 4, 6, 6, 7, 7, 8, 8, 10, 11, 11, 12, 13, 14, 14, 16, 17]
DEBUG:client:__main__ autoSelectStage my all cards:[3, 4, 6, 6, 7, 7, 8, 8, 10, 11, 11, 12, 13, 14, 14, 16, 17]
DEBUG:client:Robot finish get card!
DEBUG:client:finish card:[<__main__.CardBg object at 0x02FA8FB0>, <__main__.CardBg object at 0x02F3ACB0>, <__main__.CardBg object at 0x02F25750>, <__main__.CardBg object at 0x02F2FE50>, <__main__.CardBg object at 0x02F251B0>, <__main__.CardBg object at 0x02F15650>, <__main__.CardBg object at 0x02F15E70>, <__main__.CardBg object at 0x02F3AE70>, <__main__.CardBg object at 0x02F3A1D0>, <__main__.CardBg object at 0x02F99970>, <__main__.CardBg object at 0x02FB27D0>, <__main__.CardBg object at 0x02F99DB0>, <__main__.CardBg object at 0x02F99290>, <__main__.CardBg object at 0x02F2F570>, <__main__.CardBg object at 0x02F3A950>, <__main__.CardBg object at 0x02F0A4B0>, <__main__.CardBg object at 0x02F99AF0>] cards:[14, 10, 4, 8, 4, 3, 3, 10, 8, 11, 15, 12, 10, 6, 9, 3, 12]cards len:17
DEBUG:client:sortSpriteCards :[<__main__.CardBg object at 0x02F15650>, <__main__.CardBg object at 0x02F15E70>, <__main__.CardBg object at 0x02F0A4B0>, <__main__.CardBg object at 0x02F25750>, <__main__.CardBg object at 0x02F251B0>, <__main__.CardBg object at 0x02F2F570>, <__main__.CardBg object at 0x02F2FE50>, <__main__.CardBg object at 0x02F3A1D0>, <__main__.CardBg object at 0x02F3A950>, <__main__.CardBg object at 0x02F3ACB0>, <__main__.CardBg object at 0x02F3AE70>, <__main__.CardBg object at 0x02F99290>, <__main__.CardBg object at 0x02F99970>, <__main__.CardBg object at 0x02F99DB0>, <__main__.CardBg object at 0x02F99AF0>, <__main__.CardBg object at 0x02FA8FB0>, <__main__.CardBg object at 0x02FB27D0>]
DEBUG:client:my card avg score:8.35294117647
DEBUG:client:my name is :RobotPlayer2 finishi get card, my cards is:[3, 3, 3, 4, 4, 6, 8, 8, 9, 10, 10, 10, 11, 12, 12, 14, 15]
DEBUG:client:__main__ autoSelectStage my all cards:[3, 3, 3, 4, 4, 6, 8, 8, 9, 10, 10, 10, 11, 12, 12, 14, 15]
DEBUG:client:Button on_enter run!
DEBUG:client:Button on_enter run!
DEBUG:client:Button on_enter run!
DEBUG:client:Button on_enter run!
DEBUG:client:finish card:[4, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 14, 15, 15, 13, 5, 15] cards:[4, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 14, 15, 15, 13, 5, 15]cards len:20
DEBUG:client:sortSpriteCards :[4, 5, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 13, 14, 15, 15, 15]
DEBUG:client:my card avg score:9.6
DEBUG:client:my name is :Raffeale finishi get card, my cards is:[4, 5, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 13, 14, 15, 15, 15]
INFO:client: put card function . how many card is you:20
DEBUG:client:Button on_enter run!
DEBUG:client:sortSpriteCards :[5, 5, 5, 5, 6, 7, 7, 9, 9, 9, 11, 12, 13, 13, 13, 14, 15, 15, 15]
DEBUG:client:
Raffeale player put cards:[4]
WARNING:clientlayer RobotPlayer2 will put card .Current cards num is: :17 card_sprite num:17
DEBUG:client:__main__ autoSelectStage my all cards:[3, 3, 3, 4, 4, 6, 8, 8, 9, 10, 10, 10, 11, 12, 12, 14, 15]
DEBUG:client:player:RobotPlayer2HumanType 1  cards_avg:8.352941
DEBUG:client:get best stage:[6]
WARNING:clientlayer RobotPlayer2 put card result :[6] ,card num:17
DEBUG:client:sortSpriteCards :[<__main__.CardBg object at 0x02F15650>, <__main__.CardBg object at 0x02F15E70>, <__main__.CardBg object at 0x02F0A4B0>, <__main__.CardBg object at 0x02F25750>, <__main__.CardBg object at 0x02F251B0>, <__main__.CardBg object at 0x02F2FE50>, <__main__.CardBg object at 0x02F3A1D0>, <__main__.CardBg object at 0x02F3A950>, <__main__.CardBg object at 0x02F3ACB0>, <__main__.CardBg object at 0x02F3AE70>, <__main__.CardBg object at 0x02F99290>, <__main__.CardBg object at 0x02F99970>, <__main__.CardBg object at 0x02F99DB0>, <__main__.CardBg object at 0x02F99AF0>, <__main__.CardBg object at 0x02FA8FB0>, <__main__.CardBg object at 0x02FB27D0>]
DEBUG:client:
RobotPlayer2 player put cards:[6]
WARNING:clientlayer RobotPlayer1 will put card .Current cards num is: :17 card_sprite num:17
DEBUG:client:__main__ autoSelectStage my all cards:[3, 4, 6, 6, 7, 7, 8, 8, 10, 11, 11, 12, 13, 14, 14, 16, 17]
DEBUG:client:player:RobotPlayer1HumanType 1  cards_avg:9.823529
DEBUG:client:get best stage:[]
DEBUG:client:sortSpriteCards :[<__main__.CardBg object at 0x02F156D0>, <__main__.CardBg object at 0x02F254B0>, <__main__.CardBg object at 0x02F2F070>, <__main__.CardBg object at 0x02F2F210>, <__main__.CardBg object at 0x02F2F710>, <__main__.CardBg object at 0x02F2FA10>, <__main__.CardBg object at 0x02F2FF70>, <__main__.CardBg object at 0x02F3A330>, <__main__.CardBg object at 0x02F990B0>, <__main__.CardBg object at 0x02F99450>, <__main__.CardBg object at 0x02F997B0>, <__main__.CardBg object at 0x02FA8170>, <__main__.CardBg object at 0x02F99A90>, <__main__.CardBg object at 0x02FA8C50>, <__main__.CardBg object at 0x02FA8A70>, <__main__.CardBg object at 0x02FB2970>, <__main__.CardBg object at 0x02FB2B10>]
DEBUG:client:
RobotPlayer1 player put cards:[]
DEBUG:client:RobotPlayer1 player pass!
INFO:client: put card function . how many card is you:19
DEBUG:client:Button on_enter run!
DEBUG:client:Button on_enter run!
DEBUG:client:Button on_enter run!
Traceback (most recent call last):
  File "gui_main.py", line 2113, in <module>
  File "cocos\director.pyc", line 295, in init
  File "pyglet\window\win32\__init__.pyc", line 131, in __init__
  File "pyglet\window\__init__.pyc", line 559, in __init__
  File "pyglet\window\win32\__init__.pyc", line 261, in _create
  File "pyglet\gl\win32.pyc", line 263, in attach
  File "pyglet\gl\win32.pyc", line 208, in attach
pyglet.gl.ContextException: Unable to share contexts
Traceback (most recent call last):
  File "gui_main.py", line 2113, in <module>
  File "cocos\director.pyc", line 295, in init
  File "pyglet\window\win32\__init__.pyc", line 131, in __init__
  File "pyglet\window\__init__.pyc", line 559, in __init__
  File "pyglet\window\win32\__init__.pyc", line 261, in _create
  File "pyglet\gl\win32.pyc", line 263, in attach
  File "pyglet\gl\win32.pyc", line 208, in attach
pyglet.gl.ContextException: Unable to share contexts

论坛徽章:
0
9 [报告]
发表于 2013-11-04 19:38 |只看该作者
图片资源都是在网上找的!
楼上是在什么环境下运行?我只在linux的wine下运行和xp下运行了。WIN7 64貌似不行,打包后不行,不过linux一点问题都没有!
这些都是调试信息,出了最后那两行!pyglet貌似有些bug,没办法!

论坛徽章:
0
10 [报告]
发表于 2013-11-05 13:16 |只看该作者
厉害
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP