Python之游戏开发-飞机大战 想要代码文件,可以加我微信:nickchen121 #!/usr/bin/env python # coding: utf-8 import pygame import time import random from pygame.locals import * class Base(object): def __init__(self, x, y, imageName): self.x = x self.y = y self.imageName = image…
十. Python基础(10)--装饰器 1 ● 装饰器 A decorator is a function that take a function as an argument and return a function. We can use a decorator to extend the functionality of an existing function without changing its source. Decorators are syntactic sugar.…
飞机大战 #coding=utf-8 import pygame from pygame.locals import * import time import random class Base(object): def __init__(self,x,y,screen,image_name): self.x=x self.y=y self.screen=screen self.image=pygame.image.load(image_name).convert() class BaseBul…