Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# ==============================================
# file:main.py
# version: 1.0
# desc: a game of ship pvp powered by Python
# auther: TJRのTanga
# create date: 9/19/2023
# update date: 9/21/2023
# ==============================================
import sys
sys.path.append('./modules')
import pygame
import modules.funcs as funs
from modules.Options import Options
from modules.objs.ship import Ship
from modules.objs.alien import Alien
from modules.objs.stats import GameStats
from pygame.sprite import Group
from modules.objs.stats import GameStats
from modules.objs.Button import Button

"""
the function of start game
"""


def startGame():
# Pygame init & create objects
pygame.init()
pygame.display.set_caption("Flying Shots")
opts = Options()
screen = pygame.display.set_mode((opts.screen_width, opts.screen_height))
stats = GameStats(opts)
ship = Ship(opts, screen)
bullets = Group()
aliens = Group()

funs.create_fleet(opts, screen,ship,aliens)
alien = Alien(opts, screen)

pygame.display.set_caption("Alien Defense")
play_Button = Button(opts, screen, "Play")


# the loop for keeping game run
while 1:
funs.check_events(opts, screen,stats,play_Button, ship, bullets)
if stats.game_active:
funs.update_ship(ship)
funs.update_aliens(opts,stats,screen,ship,aliens,bullets)
funs.update_bullets(opts,screen,ship,aliens, bullets)
funs.update_screen(opts,screen,stats,ship,aliens,bullets,play_Button)




# Code Run!!!
if __name__ != "main":
startGame()