python游戏编程
文章平均质量分 86
lonely_gfolf
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
环绕行星轨道
import sys, random, math, pygame from pygame.locals import * class Point(object): def __init__(self, x, y): self.__x = x self.__y = y def getx(self): return self.__x def ...原创 2018-04-22 22:34:46 · 290 阅读 · 0 评论 -
python游戏编程入门
import pygame import sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode((600,500)) white = 255,255,255 blue = 0,0,200 myfont = pygame.font.Font(None, 60) textImage = myfont...原创 2018-04-19 22:52:09 · 21744 阅读 · 0 评论 -
Trivia游戏
import sys, pygame from pygame.locals import * #游戏逻辑代码在Trivia类中 #所有游戏的逻辑都在该类中实现 class Trivia(object): def __init__(self, filename): self.data = [] self.current = 0 self...原创 2018-04-20 16:30:26 · 1720 阅读 · 1 评论 -
Bomb Catcher游戏
# -*- coding: utf-8 -*- """ Created on Tue Jun 30 23:42:49 2015 @author: liuchang """ import pygame,sys,random from pygame.locals import * pygame.init() color= 255,255,0 #绘制圆心的位置 positionx=300 pos...原创 2018-04-20 21:28:42 · 703 阅读 · 0 评论 -
Analog Clock
# coding=utf8 import sys, pygame, math, random from pygame.locals import * from datetime import datetime, date, time def print_text(font, x, y, text, color=(255,255,255)): imgtext = font.rende...原创 2018-04-20 22:37:24 · 721 阅读 · 0 评论 -
用精灵实现动画
import pygame from pygame.locals import * class MySprite(pygame.sprite.Sprite):#image图像,rect位置 def __init__(self, target): pygame.sprite.Sprite.__init__(self) self.target_surface ...原创 2018-04-26 22:24:05 · 1061 阅读 · 0 评论 -
tensorflow保存python文件
原创 2018-04-26 23:06:12 · 357 阅读 · 0 评论 -
精灵冲突检测
#遇见两种bug,一个是导入MyLibrary 必须是python文件 #第二个是由于MyLibrary缺少函数,导致元素对象没有collide import itertools, sys, time, random, math, pygame from pygame.locals import * from MyLibrary import * def calc_velocity(direct...原创 2018-04-27 12:47:24 · 572 阅读 · 0 评论
分享