- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 pygame常识&技巧(2)
取保模块import不会产生错误pygame中有一些模块是测试的,比如camera等,说不定哪天就没了。在写代码的时候需要进行容错处理try: import sys import random import math import os import getopt import pygame from socket import * from pygame.locals
2013-07-30 19:57:33 932
原创 pygame常识&技巧(1)
自带example的所学pygame-1.9.1release/docs/tut/chimp/ChimpLineByLine.html1)pygame中有些模块有时是无效的,当无效时,其值为None,可以通过如下方法判断if not pygame.font: print 'Warning, fonts disabled'2)Surface.set_colorkey设置Sur
2013-07-28 19:17:37 1983
原创 pygame.event.Event
查看所有的Event只需要将event打印出来即可import pygame,sysfrom pygame.locals import *pygame.init()pygame.display.set_mode((600,480))while True: for event in pygame.event.get(): print(event)
2013-07-28 17:20:59 3620
原创 cocos2d-地图滚动
地图滚动可以使用如下模块实现Module cocos.layer.scrolling通过ScrollingManager的set_focus()来设定焦点的位置。需要给ScrollableLayer定义.px_width和.px_height两个属性这样Manager就用这两个值来显示画面。详细情况参照下面代码中注释代码示例import cocosfr
2013-07-25 18:26:01 1400
原创 Cocos2d-精灵的几个常识
性能考虑该部分是总结的cocos2d的在线文档1)如果有每个帧有25个以下的精灵需要更新,可以直接使用精灵class TLayer(cocos.layer.Layer): is_event_handler = True def __init__(self): cocos.layer.Layer.__init__(self) world_w
2013-07-01 00:39:10 1620 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人