当前位置: 首页 > news >正文

做推文封面的网站做一个静态网站要多少钱

做推文封面的网站,做一个静态网站要多少钱,赣州市亿洲网络科技有限公司,wordpress采集定时发布记得玩这个游戏的时候是初中三年级,那时候在qq空间,网页版的,是男人就坚持20秒!很好奇!玩得忘了吃饭,还是坚持不到20秒,现在给大家机会! # coding utf-8 # time 2015-02-13-20:15 #…

记得玩这个游戏的时候是初中三年级,那时候在qq空间,网页版的,是男人就坚持20秒!很好奇!玩得忘了吃饭,还是坚持不到20秒,现在给大家机会!

      

# coding = utf-8
# time 2015-02-13-20:15
# by qiuimport pygame, sys, time, os, random
from pygame.locals import *# set up pygame
pygame.init()# set up the window
WINDOWWIDTH = 640
WINDOWHEIGHT = 480
windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
pygame.display.set_caption('是男人就坚持20秒-Python版本')# set up direction variables
DOWNLEFT = 1
DOWNRIGHT = 3
UPLEFT = 7
UPRIGHT = 9MOVESPEED = 10
# set FPS
FPS = 40# set up the colors
BLACK = (0, 0, 0)RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)
colors = {1:RED, 2:GREEN, 3:BLUE, 4:WHITE}
# move
moveleft = False
moveright = False
moveup = False
movedown = False
# set time
time.clock()
mainClock = pygame.time.Clock()# set up the block data structureb1 = {'rect':pygame.Rect(random.randint(100, 500), random.randint(100, 500), random.randint(10, 100), random.randint(10, 100)),'color':colors[random.randint(1, 4)], 'dir':UPRIGHT}
b2 = {'rect':pygame.Rect(random.randint(100, 500), random.randint(100, 500), random.randint(10, 100), random.randint(10, 100)),'color':colors[random.randint(1, 4)], 'dir':DOWNLEFT}
b3 = {'rect':pygame.Rect(random.randint(100, 500), random.randint(100, 500), random.randint(10, 100), random.randint(10, 100)),'color':colors[random.randint(1, 4)], 'dir':UPLEFT}
b4 = {'rect':pygame.Rect(random.randint(100, 500), random.randint(100, 500), random.randint(10, 100), random.randint(10, 100)),'color':colors[random.randint(1, 4)], 'dir':DOWNRIGHT}player = {'rect':pygame.Rect(0, 0, 20, 20),'color':colors[random.randint(1, 4)]}
blocks = [b1, b2, b3, b4]
# show text
def show_text(surface_handle, text, pos, color, font_bold = False, font_size = 13, font_italic = False):   cur_font = pygame.font.SysFont('Courier', font_size)  cur_font.set_bold(font_bold)  cur_font.set_italic(font_italic)   text_fmt = cur_font.render(text, 1, color)  surface_handle.blit(text_fmt, pos)# run the game loop
mainloop = True
while mainloop:# check for the QUIT eventfor event in pygame.event.get():if event.type == QUIT:pygame.quit()sys.exit()# draw the black background onto the surfacewindowSurface.fill(BLACK)# move playerif event.type == KEYDOWN:if event.key == K_LEFT or event.key == ord('a'):moveleft = Truemoveright = Falseif event.key == K_RIGHT or event.key == ord('b'):moveright = Truemoveleft = Falseif event.key == K_UP or event.key == ord('w'):moveup = Truemovedown = Falseif event.key == K_DOWN or event.key == ord('s'):movedown = Truemoveup = Falseif event.type == KEYUP:if event.key == K_ESCAPE:pygame.quit()sys.exit()if event.key == K_LEFT or event.key == ord('a'):moveleft = Falseif event.key == K_RIGHT or event.key == ord('d'):moveright = Falseif event.key == K_UP or event.key == ord('w'):moveup = Falseif event.key == K_DOWN or event.key == ord('s'):movedown = Falseif event.type == MOUSEBUTTONUP:player['rect'].left = event.pos[0]player['rect'].top = event.pos[1]if moveleft and player['rect'].left > 0:player['rect'].left -= MOVESPEEDif moveright and player['rect'].right < WINDOWWIDTH:player['rect'].right += MOVESPEEDif moveup and player['rect'].top > 0:player['rect'].top -= MOVESPEEDif movedown and player['rect'].bottom < WINDOWHEIGHT:player['rect'].top += MOVESPEEDfor b in blocks:# move the block data structureif b['dir'] == DOWNLEFT:b['rect'].left -= MOVESPEEDb['rect'].top += MOVESPEEDif b['dir'] == DOWNRIGHT:b['rect'].left += MOVESPEEDb['rect'].top += MOVESPEEDif b['dir'] == UPLEFT:b['rect'].left -= MOVESPEEDb['rect'].top -= MOVESPEEDif b['dir'] == UPRIGHT:b['rect'].left += MOVESPEEDb['rect'].top -= MOVESPEED# check if the block has move out of the windowif b['rect'].top < 0:# block has moved past the topif b['dir'] == UPLEFT:b['dir'] = DOWNLEFTif b['dir'] == UPRIGHT:b['dir'] = DOWNRIGHTif b['rect'].bottom > WINDOWHEIGHT:# block has moved past the bottomif b['dir'] == DOWNLEFT:b['dir'] = UPLEFTif b['dir'] == DOWNRIGHT:b['dir'] = UPRIGHTif b['rect'].left < 0:# block has moved past the left sideif b['dir'] == DOWNLEFT:b['dir'] = DOWNRIGHTif b['dir'] == UPLEFT:b['dir'] = UPRIGHTif b['rect'].right > WINDOWWIDTH:# block has moved past the right sideif b['dir'] == DOWNRIGHT:b['dir'] = DOWNLEFTif b['dir'] == UPRIGHT:b['dir'] = UPLEFT# draw the block onto the surfacepygame.draw.rect(windowSurface, b['color'], b['rect'])# draw player onto the surface   pygame.draw.rect(windowSurface, player['color'], player['rect'])# show some infotext_time = "time:%.3d" % (time.clock())show_text(windowSurface, text_time, (20, 400), (0, 255, 0), True)  text_pos = "pos:(%d,%d)" % (player['rect'].left, player['rect'].top)show_text(windowSurface, text_pos, (20, 420), (0, 255, 255), True)for bb in blocks:# game overif player['rect'].colliderect(bb['rect']):mainloop = Falsebreak;pygame.display.update()mainClock.tick(FPS)
# open show score
try:fo = open("foo.txt", 'r')show_time = fo.read()
except IOError:print ("can\'t open file or read data!")sys.exit()
finally:fo.close()
curtime = "%.3d" % time.clock()
if int(curtime) > int(show_time):try:fo = open("foo.txt", 'w')fo.write(str(curtime))except IOError:print ("can\'t open file or write data!")sys.exit()finally:fo.close()# show game over 
mainloop = True
show_info = "Game over!"
while mainloop:for event in pygame.event.get():if event.type == QUIT:pygame.quit()sys.exit()try:fo = open("foo.txt", 'r')tmp_time = fo.read()except IOError:print ("can\'t open file or read data!")finally:fo.close()text_info = "Max time:" + tmp_timeshow_text(windowSurface, show_info, (120, 180), GREEN, True, 60)show_text(windowSurface, text_info, (20, 380), WHITE, True)pygame.display.update()


http://www.yayakq.cn/news/894605/

相关文章:

  • 权威的岑溪网站开发镇江网站优化哪家好
  • 山东济南网站制作优化网站群建设思路
  • 建材企业网站模板wordpress 分类目录前缀
  • 杭州模板建站定制网站wordpress文章添加动态数据
  • wordpress主页广告梧州seo公司
  • 高台网站建设wordpress自定义字段值调用
  • 俄文网站备案的域名做电影网站
  • 博州住房和城乡建设局网站老吕爱分享 wordpress
  • 广东企业网站seo哪里好深圳保障性住房官网
  • 专业网站建设模板做百度企业网站有什么好处
  • 查房价的官方网站郑州网站推广公司哪家好
  • 个人网站免费源码关于新品牌的营销策划
  • 徐州网站建设 网站推广重庆包装设计公司
  • 公共法律知识培训网站网站群 米拓
  • 网页设计与网站建设作业微信企业邮箱怎么注册
  • 大学网站建设的意义如皋做网站的
  • 武进做网站做零售去哪个外贸网站
  • 文登城乡建设局网站成都高端网页设计公司
  • 微信公众号托管代运营潍坊百度快速排名优化
  • 贵州网站制作公司电话四字顺口名字公司
  • 网站主页设计优点wordpress 大数据量查询
  • 用dw做网站首页网站搭建工作怎么样
  • 网站服务器重做系统怎么做青海风控平台app
  • 网站建设绿茶进销存系统
  • 做商品网站需要营业执照外贸网站建设及推广
  • 银川网站建设0951网站开发需要客户做什么
  • 外贸建站平台免费建站有哪些
  • 浏览器显示不安全网站建设网站设计制作费用多少
  • 十三师建设局网站网络优化有哪些主要流程
  • 苏州做网站哪家比较好详情页在线设计网站推荐