You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
class Settings ( ) :
""" 用于存储外来入侵的所有设置的类 """
def __init__ ( self ) :
""" 初始化游戏的静态设置 """
# 窗口设置
self . screen_width = 1200
self . screen_height = 800
self . bg_color = ( 230 , 230 , 230 )
# 人的绘制
self . man_limit = 3
# 子弹的设置
self . bullet_width = 3
self . bullet_height = 15
self . bullet_color = 60 , 60 , 60
self . bullets_allowed = 4
# 靶子的设置
self . fleet_drop_speed = 11
#游戏加速的速度
self . speedup_scale = 1.5
# 外来点值增加的速度
self . score_scale = 1.5
self . initialize_dynamic_settings ( )
def initialize_dynamic_settings ( self ) :
""" 初始化在整个游戏中更改的设置 """
self . man_speed_factor = 1.5
self . bullet_speed_factor = 3
self . bazi_speed_factor = 1
# 得分
self . bazi_points = 50
# 方向( fleet_direction) 1表示右, -1表示左
self . fleet_direction = 1
def increase_speed ( self ) :
""" 增加速度设置和外来点值 """
self . man_speed_factor * = self . speedup_scale
self . bullet_speed_factor * = self . speedup_scale
self . bazi_speed_factor * = self . speedup_scale
self . bazi_points = int ( self . bazi_points * self . score_scale )