This commit is contained in:
Wang Zhiyu 2022-04-18 00:13:14 +08:00
parent 9cfd26e75f
commit a364ed7a78
187 changed files with 2030 additions and 15 deletions

View File

@ -1,6 +1,12 @@
# Plane Fighting
## 一个跨平台的简易"飞机大战"程序
## 基于 Python & PyGame 运行
## 图标库来自 IconFont
## 相应的版权归作者所有
## 本目录中其他所有的文件根据 GPL 3.0 协议开源
# Plane Fighting (plane_fighting)
## 简介
一个跨平台的简易"飞机大战"小游戏
## 支持
基于Python & PyGame 运行
可通过 Buildozer 打包为移动应用
## 协议
图标库(./images/)来自 IconFont
音效库(./sound/)来自网络
字体库(./font)来自 Ubuntu
相应的版权归作者所有
本目录中其他所有的源代码文件根据 GPL 3.0 协议开源

0
Plane_Fighting/buildozer.spec Executable file → Normal file
View File

1
Plane_Fighting/bullet.py Executable file → Normal file
View File

@ -1,4 +1,5 @@
import pygame,os
abspath = os.getcwd() + "/"
class Bullet1(pygame.sprite.Sprite):
def __init__(self, position):

0
Plane_Fighting/enemy.py Executable file → Normal file
View File

0
Plane_Fighting/font/font-2.ttf Executable file → Normal file
View File

0
Plane_Fighting/font/font.ttf Executable file → Normal file
View File

0
Plane_Fighting/images/again.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Plane_Fighting/images/background.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

0
Plane_Fighting/images/bomb.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/bomb_supply.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
Plane_Fighting/images/bullet1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

0
Plane_Fighting/images/bullet2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

0
Plane_Fighting/images/bullet_supply.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
Plane_Fighting/images/enemy1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
Plane_Fighting/images/enemy1_down1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
Plane_Fighting/images/enemy1_down2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
Plane_Fighting/images/enemy1_down3.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
Plane_Fighting/images/enemy1_down4.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
Plane_Fighting/images/enemy2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

0
Plane_Fighting/images/enemy2_down1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/enemy2_down2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/enemy2_down3.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/enemy2_down4.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/enemy2_hit.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
Plane_Fighting/images/enemy3_down1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_down2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_down3.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_down4.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_down5.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_down6.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_hit.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

0
Plane_Fighting/images/enemy3_n1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

0
Plane_Fighting/images/enemy3_n2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

0
Plane_Fighting/images/gameover.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
Plane_Fighting/images/icon.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

0
Plane_Fighting/images/life.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

0
Plane_Fighting/images/loading.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
Plane_Fighting/images/me1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
Plane_Fighting/images/me2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
Plane_Fighting/images/me_destroy_1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Plane_Fighting/images/me_destroy_2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Plane_Fighting/images/me_destroy_3.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Plane_Fighting/images/me_destroy_4.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Plane_Fighting/images/pause_nor.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 868 B

0
Plane_Fighting/images/pause_pressed.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 868 B

0
Plane_Fighting/images/resume_nor.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

0
Plane_Fighting/images/resume_pressed.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

0
Plane_Fighting/main.py Executable file → Normal file
View File

0
Plane_Fighting/myplane.py Executable file → Normal file
View File

8
Plane_Fighting/pyinstaller.spec Executable file → Normal file
View File

@ -4,10 +4,10 @@
block_cipher = None
a = Analysis(['main.py'],
a = Analysis(['main.py','bullet.py','enemy.py','myplane.py','supply.py'],
pathex=[],
binaries=[(./images/*.png, images)]
datas=[],
binaries=[("font", "images", "sound")]
datas=["record.dat"],
hiddenimports=[],
hookspath=[],
hooksconfig={},
@ -26,7 +26,7 @@ exe = EXE(pyz,
a.zipfiles,
a.datas,
[],
name='main',
name='Plane Fighting',
debug=False,
bootloader_ignore_signals=False,
strip=False,

0
Plane_Fighting/record.dat Executable file → Normal file
View File

0
Plane_Fighting/sound/bullet.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/button.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/enemy1_down.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/enemy2_down.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/enemy3_down.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/enemy3_flying.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/game_music.ogg Executable file → Normal file
View File

0
Plane_Fighting/sound/get_bomb.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/get_bullet.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/loading_game.ogg Executable file → Normal file
View File

0
Plane_Fighting/sound/me_down.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/supply.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/upgrade.wav Executable file → Normal file
View File

0
Plane_Fighting/sound/use_bomb.wav Executable file → Normal file
View File

7
Plane_Fighting/supply.py Executable file → Normal file
View File

@ -1,11 +1,12 @@
import pygame
import pygame,os
from random import *
abspath = os.getcwd() + "/"
class Bullet_Supply(pygame.sprite.Sprite):
def __init__(self, bg_size):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("images/bullet_supply.png").convert_alpha()
self.image = pygame.image.load(abspath + "images/bullet_supply.png").convert_alpha()
self.rect = self.image.get_rect()
self.width, self.height = bg_size[0], bg_size[1]
self.rect.left, self.rect.bottom = \
@ -29,7 +30,7 @@ class Bomb_Supply(pygame.sprite.Sprite):
def __init__(self, bg_size):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("images/bomb_supply.png").convert_alpha()
self.image = pygame.image.load(abspath + "images/bomb_supply.png").convert_alpha()
self.rect = self.image.get_rect()
self.width, self.height = bg_size[0], bg_size[1]
self.rect.left, self.rect.bottom = \

View File

@ -1,2 +1,17 @@
# 我的一些分散的代码文件
# 主要用于通过 GitPod 在线编译
# Tiny Project
## 说明
分散的代码文件
一个文件夹代表一个小的代码集合
不同文件夹所使用的开源协议不同
有些工具虽然很小, 但却十分有用
## 列表
### 单目录 (root)
|名称|路径|介绍|语言|
|:---|:---|----|----|
|LAN++|./lanpp|一个跨平台的简易局域网文件传输工具|Python|
|Plane Fighting|./plane_fighting|一个跨平台的简易"飞机大战"小游戏|Python|
|Python HTTPS Server|./python_https_server|一个 HTTPS 网络服务器程序|Python|
### 单文件 (onefile)
|文件名|介绍|语言|
|----|----|----|
|file_reader.cpp|输出文件内容至终端|C++|

10
lanpp/README.md Normal file
View File

@ -0,0 +1,10 @@
# LAN++ (lanpp)
## 简介
一个跨平台的简易局域网文件传输工具
## 支持
基于 Python 语言编写
底层依赖库: pyperclip & pyftpdlib
UI 基于 Tkinter, 准备改写成 KivyMD
将来可通过 Buildozer 打包为移动应用
## 协议
本目录中所有的源代码文件根据 GPL 3.0 协议开源

21
lanpp/ftpserver.py Normal file
View File

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from pyftpdlib.authorizers import DummyAuthorizer
import json
def jsonget(key_name):
with open("setting.json") as f:
json_data = f.read()
data = json.loads(json_data)
f.close()
return data[key_name]
def start():
authorizer = DummyAuthorizer()
authorizer.add_user(jsonget("ftpserveruser"), jsonget("ftpserverpass"), jsonget("ftpserverroot"), perm='elradfmwM')
handler = FTPHandler
handler.authorizer = authorizer
server = FTPServer(('localhost', int(jsonget("ftpserverport"))), handler)
server.serve_forever()
if __name__ == '__main__':
start()

142
lanpp/main-gui.py Normal file
View File

@ -0,0 +1,142 @@
import pyperclip
import ftpserver
import os
import json
import sys
import socket
import webserver
import webbrowser
from tkinter import *
from tkinter import messagebox
from ttkthemes import *
from tkinter.ttk import *
from multiprocessing import Process
def getip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('192.168.1.1', 0))
ip = s.getsockname()[0]
except:
ip = "localhost"
finally:
s.close()
return ip
def jsonget(key_name):
with open("setting.json") as f:
json_data = f.read()
data = json.loads(json_data)
f.close()
return data[key_name]
def webserver_ui():
if True :
#webserverui_status = 1
subwindow = ThemedTk(theme="yaru", toplevel=True, themebg=True)
subwindow.title("WebServer | LAN++ Manager")
subwindow.geometry("850x500")
os.chdir(static_path)
task = Process(target=webserver.start)
def start():
task.start()
print("started")
def __close__():
task.terminate()
os.chdir(static_path)
print("closed")
def close():
if task.is_alive() == False:
start()
__close__()
os.chdir(static_path)
subwindow.destroy()
def copylink():
pyperclip.copy("http://" + str(getip()) + ":" + jsonget("webserverport"))
ntext = " 点击按钮以控制[浏览器文件管理服务]\n [启动] - 启动服务\n [关闭窗口并退出] - 退出窗口(退出服务)\n [复制访问链接] - 复制链接以便访问服务" + '当前配置:\n 端口:' + jsonget("ftpserverport") + "\n 目录: " + jsonget("webserverroot") + "\n 打开服务后请用浏览器打开此链接以操作文件: [http://" + str(getip()) + ":" + jsonget("webserverport") + "]\n"
lbl1 = Label(subwindow, text=ntext)
lbl1.grid(column=1, row=1)
wtext = " 已知Bug:终止服务后,端口仍会占用一段时间,建议终止服务后一分钟后重新启动服务\n 注意:在不了解此程序文档时请勿打开多个相同服务,如需要,可在Wiki的[特技]一栏中找到方法."
lbl2 = Label(subwindow, text=wtext)
lbl2.grid(column=1, row=2)
start_btn = Button(subwindow, text="启动", command=start)
start_btn.grid(column=1, row=3)
close_btn = Button(subwindow, text="关闭窗口并退出", command=close)
close_btn.grid(column=1, row=4)
copy_btn = Button(subwindow, text="复制访问链接", command=copylink)
copy_btn.grid(column=1, row=5)
subwindow.protocol("WM_DELETE_WINDOW", close)
subwindow.mainloop()
def ftpserver_ui():
if True :
#webserverui_status = 1
subwindow = ThemedTk(theme="yaru", toplevel=True, themebg=True)
subwindow.title("FTPServer | LAN++ Manager")
subwindow.geometry("850x500")
os.chdir(static_path)
task = Process(target=ftpserver.start)
def start():
task.start()
print("started")
def __close__():
task.terminate()
os.chdir(static_path)
print("closed")
def close():
if task.is_alive() == False:
start()
__close__()
os.chdir(static_path)
subwindow.destroy()
def copylink():
pyperclip.copy("ftp://" + jsonget("ftpserveruser") + "@" + str(getip()) + ":" + jsonget("ftpserverport"))
ntext = " 点击按钮以控制[FTP文件传输服务]\n [启动] - 启动服务\n [关闭窗口并退出] - 退出窗口(退出服务)\n [复制访问链接] - 复制链接以便访问服务" + '当前配置:\n 端口:' + jsonget("ftpserverport") + "\n 目录: " + jsonget("ftpserverroot") + "\n 用户名:" + jsonget("ftpserveruser") + "\n 密码:" + jsonget("ftpserverpass") + "\n 打开服务后请通过此链接连接FTP服务器: [ftp://" + jsonget("ftpserveruser") + "@" + str(getip()) + ":" + jsonget("ftpserverport") + "]"
lbl1 = Label(subwindow, text=ntext)
lbl1.grid(column=1, row=1)
wtext = " 已知Bug:终止服务后,端口仍会占用一段时间,建议终止服务后一分钟后重新启动服务\n 注意:在不了解此程序文档时请勿打开多个相同服务,如需要,可在Wiki的[特技]一栏中找到方法."
lbl2 = Label(subwindow, text=wtext)
lbl2.grid(column=1, row=2)
start_btn = Button(subwindow, text="启动", command=start)
start_btn.grid(column=1, row=3)
close_btn = Button(subwindow, text="关闭窗口并退出", command=close)
close_btn.grid(column=1, row=4)
copy_btn = Button(subwindow, text="复制访问链接", command=copylink)
copy_btn.grid(column=1, row=5)
subwindow.protocol("WM_DELETE_WINDOW", close)
subwindow.mainloop()
def setting_ui():
pass
def runexit():
sys.exit()
def about_ui():
def visit():
webbrowser.open("http://github.com/david-ajax/LANPP", new=0)
subwindow = ThemedTk(theme="yaru", toplevel=True, themebg=True)
subwindow.title("About | LAN++")
subwindow.geometry("470x270")
ntext = " LAN++ -- A powerful tool for local area network \n Version: 1.0 (Beta) \n Repo: http://github.com/david-ajax/LANpp \n Powered By Wang Zhiyu \n Use GPL 3.0 License"
lbl1 = Label(subwindow, text=ntext)
lbl1.grid(column=1, row=1)
visit_btn = Button(subwindow, text="Visit The Repository", command=visit)
visit_btn.grid(column=1, row=2)
exit_btn = Button(subwindow, text="Exit", command=subwindow.destroy)
exit_btn.grid(column=1, row=3)
def main():
window = ThemedTk(theme="yaru", toplevel=True, themebg=True)
window.title("LAN++ Manager")
window.geometry("800x200")
webserver = Button(window, text="浏览器文件管理服务", command=webserver_ui)
webserver.grid(column=0, row=2)
ftpserver = Button(window, text="FTP文件传输服务", command=ftpserver_ui)
ftpserver.grid(column=1, row=2)
setting = Button(window, text="设置", command=setting_ui)
setting.grid(column=2, row=2)
about = Button(window, text="关于", command=about_ui)
about.grid(column=3, row=2)
exit_btn = Button(window, text="退出", command=runexit)
exit_btn.grid(column=4, row=2)
window.mainloop()
if __name__ == '__main__':
static_path = os.getcwd()
fw=Tk()
fw.withdraw()
messagebox.showinfo(title='Welcome',message='欢迎使用LAN++ Beta Edition')
main()

9
lanpp/setting.json Normal file
View File

@ -0,0 +1,9 @@
{
"webserverport": "8083",
"webserverroot": "/",
"ftpserverport": "8082",
"ftpserverroot": "/",
"ftpserveruser": "default",
"ftpserverpass": "000000",
"A Prompt For You": "Unless the program is not available,DO NOT EDIT THIS FILE"
}

326
lanpp/webserver.py Normal file

File diff suppressed because one or more lines are too long

9
onefile/README.md Normal file
View File

@ -0,0 +1,9 @@
# 单文件 (onefile)
## 简介
单文件小程序
## 支持
每个文件都是一个不同的程序
请分别根据注释运行
## 协议
详见文件内部注释
如无注释, 根据 GPL 3.0 协议开源

31
onefile/file_reader.cpp Normal file
View File

@ -0,0 +1,31 @@
// main.cpp
// author: Wang Zhiyu
// SFIS C++ Project
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]){
fstream config;
config.open(argv[1], ios::in);
if(config){
cout << "Reading Data" << endl;
vector<string> data;
string tmp;
while(getline(config,tmp)){
data.push_back(tmp);
}
cout << "Redirect to terminal:" << endl;
for(int i = 0;i < data.size();i++){
cout << data[i] << endl;
}
config.close();
}
else{
cout << "File NOT Found" << endl;
}
cout << "Press any key to Continue...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

12
plane_fighting/README.md Normal file
View File

@ -0,0 +1,12 @@
# Plane Fighting (plane_fighting)
## 简介
一个跨平台的简易"飞机大战"小游戏
## 支持
基于Python & PyGame 运行
可通过 Buildozer 打包为移动应用
## 协议
图标库(./images/)来自 IconFont
音效库(./sound/)来自网络
字体库(./font)来自 Ubuntu
相应的版权归作者所有
本目录中其他所有的源代码文件根据 GPL 3.0 协议开源

View File

@ -0,0 +1,427 @@
[app]
# (str) Title of your application
title = Plane Fighting
# (str) Package name
package.name = plane_fighting
# (str) Package domain (needed for android/ios packaging)
package.domain = ga.imwangzhiyu
# (str) Source code where the main.py live
source.dir = .
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,ogg,wav,ttf,dat
# (list) List of inclusions using pattern matching
source.include_patterns = font/*,sound/*,images/*,record.dat
# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin, venv
# (list) List of exclusions using pattern matching
# Do not prefix with './'
#source.exclude_patterns = license,images/*/*.jpg
# (str) Application versioning (method 1)
version = 0.1
# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,pygame
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png
# (str) Icon of the application
icon.filename = %(source.dir)s/images/icon.png
# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = portrait
# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
#
# OSX Specific
#
#
# author = © Copyright Info
# change the major version of python used by the app
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
#
# Android specific
#
# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0
# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF
# (string) Presplash animation using Lottie format.
# see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/
# for general documentation.
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"
# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png
# (list) Permissions
#android.permissions = INTERNET
# (list) features (adds uses-feature -tags to manifest)
#android.features = android.hardware.usb.host
# (int) Target Android API, should be as high as possible.
#android.api = 27
# (int) Minimum API your APK / AAB will support.
#android.minapi = 21
# (int) Android SDK version to use
#android.sdk = 20
# (str) Android NDK version to use
#android.ndk = 19b
# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =
# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False
# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False
# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.kivy.android.PythonActivity
# (str) Full name including package path of the Java class that implements Android Activity
# use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity
#android.activity_class_name = org.kivy.android.PythonActivity
# (str) Extra xml to write directly inside the <manifest> element of AndroidManifest.xml
# use that parameter to provide a filename from where to load your custom XML code
#android.extra_manifest_xml = ./src/android/extra_manifest.xml
# (str) Extra xml to write directly inside the <manifest><application> tag of AndroidManifest.xml
# use that parameter to provide a filename from where to load your custom XML arguments:
#android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml
# (str) Full name including package path of the Java class that implements Python Service
# use that parameter to set custom Java class instead of PythonService
#android.service_class_name = org.kivy.android.PythonService
# (str) Android app theme, default is ok for Kivy-based app
# android.apptheme = "@android:style/Theme.NoTitleBar"
# (list) Pattern to whitelist for the whole project
#android.whitelist =
# (str) Path to a custom whitelist file
#android.whitelist_src =
# (str) Path to a custom blacklist file
#android.blacklist_src =
# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =
# (list) Android AAR archives to add
#android.add_aars =
# (list) Put these files or directories in the apk assets directory.
# Either form may be used, and assets need not be in 'source.include_exts'.
# 1) android.add_assets = source_asset_relative_path
# 2) android.add_assets = source_asset_path:destination_asset_relative_path
#android.add_assets =
# (list) Gradle dependencies to add
#android.gradle_dependencies =
# (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies'
# contains an 'androidx' package, or any package from Kotlin source.
# android.enable_androidx requires android.api >= 28
#android.enable_androidx = False
# (list) add java compile options
# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
# see https://developer.android.com/studio/write/java8-support for further information
# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"
# (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies}
# please enclose in double quotes
# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =
# (list) packaging options to add
# see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
# can be necessary to solve conflicts in gradle_dependencies
# please enclose in double quotes
# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_packaging_options =
# (list) Java classes to add as activities to the manifest.
#android.add_activities = com.example.ExampleActivity
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =
# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard
# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_arm64_v8a = libs/android-v8/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so
# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False
# (list) Android application meta-data to set (key=value format)
#android.meta_data =
# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =
# (list) Android shared libraries which will be added to AndroidManifest.xml using <uses-library> tag
#android.uses_library =
# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D
# (bool) Android logcat only display log for activity's pid
#android.logcat_pid_only = False
# (str) Android additional adb arguments
#android.adb_args = -H host.docker.internal
# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1
# (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
# In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time.
android.archs = arm64-v8a, armeabi-v7a
# (int) overrides automatic versionCode computation (used in build.gradle)
# this is not the same as app version and should only be edited if you know what you're doing
# android.numeric_version = 1
# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True
# (str) XML file for custom backup rules (see official auto backup documentation)
# android.backup_rules =
# (str) If you need to insert variables into your AndroidManifest.xml file,
# you can do so with the manifestPlaceholders property.
# This property takes a map of key-value pairs. (via a string)
# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"]
# android.manifest_placeholders = [:]
# (bool) disables the compilation of py to pyc/pyo files when packaging
# android.no-compile-pyo = True
# (str) The format used to package the app for release mode (aab or apk).
# android.release_artifact = aab
#
# Python for android (p4a) specific
#
# (str) python-for-android URL to use for checkout
#p4a.url =
# (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)
#p4a.fork = kivy
# (str) python-for-android branch to use, defaults to master
#p4a.branch = master
# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
#p4a.commit = HEAD
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =
# (str) Filename to the hook for p4a
#p4a.hook =
# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2
# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =
# Control passing the --use-setup-py vs --ignore-setup-py to p4a
# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false
# (str) extra command line arguments to pass when invoking pythonforandroid.toolchain
#p4a.extra_args =
#
# iOS specific
#
# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master
# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.10.0
# (bool) Whether or not to sign the code
ios.codesign.allowed = false
# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"
# (str) The development team to use for signing the debug version
#ios.codesign.development_team.debug = <hexstring>
# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s
# (str) The development team to use for signing the release version
#ios.codesign.development_team.release = <hexstring>
# (str) URL pointing to .ipa file to be installed
# This option should be defined along with `display_image_url` and `full_size_image_url` options.
#ios.manifest.app_url =
# (str) URL pointing to an icon (57x57px) to be displayed during download
# This option should be defined along with `app_url` and `full_size_image_url` options.
#ios.manifest.display_image_url =
# (str) URL pointing to a large icon (512x512px) to be used by iTunes
# This option should be defined along with `app_url` and `display_image_url` options.
#ios.manifest.full_size_image_url =
[buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer
# (str) Path to build output (i.e. .apk, .aab, .ipa) storage
# bin_dir = ./bin
# -----------------------------------------------------------------------------
# List as sections
#
# You can define all the "list" as [section:key].
# Each line will be considered as a option to the list.
# Let's take [app] / source.exclude_patterns.
# Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
# This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#
# -----------------------------------------------------------------------------
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(demo)" in the name
# and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
# Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

45
plane_fighting/bullet.py Normal file
View File

@ -0,0 +1,45 @@
import pygame,os
abspath = os.getcwd() + "/"
class Bullet1(pygame.sprite.Sprite):
def __init__(self, position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(abspath + "images/bullet1.png").convert_alpha()
self.rect = self.image.get_rect()
self.rect.left, self.rect.top = position
self.speed = 11
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(self, position):
self.rect.left, self.rect.top = position
self.active = True
class Bullet2(pygame.sprite.Sprite):
def __init__(self, position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(abspath + "images/bullet2.png").convert_alpha()
self.rect = self.image.get_rect()
self.rect.left, self.rect.top = position
self.speed = 14#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(self, position):
self.rect.left, self.rect.top = position
self.active = True

118
plane_fighting/enemy.py Normal file
View File

@ -0,0 +1,118 @@
import pygame,os
from random import *
abspath = os.getcwd() + "/"
class SmallEnemy(pygame.sprite.Sprite):
def __init__(self, bg_size):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(abspath + "images/enemy1.png").convert_alpha()
self.destroy_images = []
self.destroy_images.extend([\
pygame.image.load(abspath + "images/enemy1_down1.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy1_down2.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy1_down3.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy1_down4.png").convert_alpha() \
])
self.rect = self.image.get_rect()
self.width, self.height = bg_size[0], bg_size[1]
self.speed = 2
self.active = True
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-5 * self.height, 0)
self.mask = pygame.mask.from_surface(self.image)
def move(self):
if self.rect.top < self.height:
self.rect.top += self.speed
else:
self.reset()
def reset(self):
self.active = True
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-5 * self.height, 0)
class MidEnemy(pygame.sprite.Sprite):
energy = 8
def __init__(self, bg_size):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(abspath + "images/enemy2.png").convert_alpha()
self.image_hit = pygame.image.load(abspath + "images/enemy2_hit.png").convert_alpha()
self.destroy_images = []
self.destroy_images.extend([\
pygame.image.load(abspath + "images/enemy2_down1.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy2_down2.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy2_down3.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy2_down4.png").convert_alpha() \
])
self.rect = self.image.get_rect()
self.width, self.height = bg_size[0], bg_size[1]
self.speed = 1
self.active = True
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-10 * self.height, -self.height)
self.mask = pygame.mask.from_surface(self.image)
self.energy = MidEnemy.energy
self.hit = False
def move(self):
if self.rect.top < self.height:
self.rect.top += self.speed
else:
self.reset()
def reset(self):
self.active = True
self.energy = MidEnemy.energy
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-10 * self.height, -self.height)
class BigEnemy(pygame.sprite.Sprite):
energy = 20
def __init__(self, bg_size):
pygame.sprite.Sprite.__init__(self)
self.image1 = pygame.image.load(abspath + "images/enemy3_n1.png").convert_alpha()
self.image2 = pygame.image.load(abspath + "images/enemy3_n2.png").convert_alpha()
self.image_hit = pygame.image.load(abspath + "images/enemy3_hit.png").convert_alpha()
self.destroy_images = []
self.destroy_images.extend([\
pygame.image.load(abspath + "images/enemy3_down1.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy3_down2.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy3_down3.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy3_down4.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy3_down5.png").convert_alpha(), \
pygame.image.load(abspath + "images/enemy3_down6.png").convert_alpha() \
])
self.rect = self.image1.get_rect()
self.width, self.height = bg_size[0], bg_size[1]
self.speed = 1
self.active = True
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-15 * self.height, -5 * self.height)
self.mask = pygame.mask.from_surface(self.image1)
self.energy = BigEnemy.energy
self.hit = False
def move(self):
if self.rect.top < self.height:
self.rect.top += self.speed
else:
self.reset()
def reset(self):
self.active = True
self.energy = BigEnemy.energy
self.rect.left, self.rect.top = \
randint(0, self.width - self.rect.width), \
randint(-15 * self.height, -5 * self.height)

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Some files were not shown because too many files have changed in this diff Show More