资源简介
用python中的pygame模块所写的飞机大战游戏,以及资源。
包括代码,游戏运行的音效,图片。可直接运行

代码片段和文件信息
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pygame
class Bullet1(pygame.sprite.Sprite):
def __init__(selfposition):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(“images/bullet1.png“).convert_alpha()
self.rect = self.image.get_rect()
self.rect.leftself.rect.top = position
self.speed = 12
self.active = False
self.mask = pygame.mask.from_surface(self.image)
def move(self):
self.rect.top -= self.speed
if self.rect.top<0:
self.active = False
def reset(selfposition):
self.rect.leftself.rect.top = position
self.active = True
class Bullet2(pygame.sprite.Sprite):
def __init__(selfposition):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(“images/bullet2.png“).convert_alpha()
self.rect = self.image.get_rect()
self.rect.leftself.rect.top = position
self.speed = 14
self.active = False
self.mask = pygame.mask.from_surface(self.image)
def move(self):
self.rect.top -= self.speed
if self.rect.top<0:
self.active = False
def reset(selfposition):
self.rect.leftself.rect.top = position
self.active = True
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-02-02 22:45 aircraft battle\.ipynb_checkpoints\
文件 2297 2020-02-02 16:15 aircraft battle\.ipynb_checkpoints\bullet-checkpoint.ipynb
文件 5835 2020-02-01 21:05 aircraft battle\.ipynb_checkpoints\enemy-checkpoint.ipynb
文件 23209 2020-02-02 22:34 aircraft battle\.ipynb_checkpoints\main-checkpoint.ipynb
文件 2996 2020-02-02 19:37 aircraft battle\.ipynb_checkpoints\myplane-checkpoint.ipynb
文件 2532 2020-02-02 14:53 aircraft battle\.ipynb_checkpoints\supply-checkpoint.ipynb
目录 0 2020-02-02 22:45 aircraft battle\__pycache__\
文件 1771 2020-02-02 16:16 aircraft battle\__pycache__\bullet.cpython-37.pyc
文件 3986 2020-02-01 21:16 aircraft battle\__pycache__\enemy.cpython-37.pyc
文件 1994 2020-02-02 20:29 aircraft battle\__pycache__\myplane.cpython-37.pyc
文件 2073 2020-02-02 14:54 aircraft battle\__pycache__\supply.cpython-37.pyc
文件 2297 2020-02-02 16:15 aircraft battle\bullet.ipynb
文件 1288 2020-02-02 16:15 aircraft battle\bullet.py
文件 5843 2020-02-01 21:10 aircraft battle\enemy.ipynb
文件 4465 2020-02-01 21:12 aircraft battle\enemy.py
目录 0 2020-02-02 22:45 aircraft battle\font\
文件 78500 2015-07-24 18:05 aircraft battle\font\font.ttf
目录 0 2020-02-02 22:45 aircraft battle\images\
文件 4088 2018-12-21 20:35 aircraft battle\images\again.png
文件 38589 2018-12-21 20:35 aircraft battle\images\background.png
文件 5641 2018-12-21 20:35 aircraft battle\images\bomb.png
文件 7609 2018-12-21 20:35 aircraft battle\images\bomb_supply.png
文件 7153 2018-12-21 20:35 aircraft battle\images\bullet_supply.png
文件 292 2018-12-21 20:35 aircraft battle\images\bullet1.png
文件 289 2018-12-21 20:35 aircraft battle\images\bullet2.png
文件 3232 2018-12-21 20:51 aircraft battle\images\enemy1.png
文件 3469 2018-12-21 20:35 aircraft battle\images\enemy1_down1.png
文件 3932 2018-12-21 20:35 aircraft battle\images\enemy1_down2.png
文件 5287 2018-12-21 20:35 aircraft battle\images\enemy1_down3.png
文件 2040 2018-12-21 20:35 aircraft battle\images\enemy1_down4.png
文件 7864 2018-12-21 20:35 aircraft battle\images\enemy2.png
............此处省略46个文件信息
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论