区别透明度

This commit is contained in:
星外之神 2022-04-20 22:46:13 +08:00
parent 369bdcf747
commit 64587b8bff
4 changed files with 4 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -190,8 +190,10 @@ class Plant(pg.sprite.Sprite):
self.animate_timer = self.current_time self.animate_timer = self.current_time
self.image = self.frames[self.frame_index] self.image = self.frames[self.frame_index]
if ((self.current_time - self.hit_timer) < 200) or (self.current_time - self.highlightTime < 200): if (self.current_time - self.highlightTime < 200):
self.image.set_alpha(150) self.image.set_alpha(150)
elif ((self.current_time - self.hit_timer) < 200):
self.image.set_alpha(192)
else: else:
self.image.set_alpha(255) self.image.set_alpha(255)

View File

@ -182,7 +182,7 @@ class Zombie(pg.sprite.Sprite):
if (self.current_time - self.hit_timer) >= 200: if (self.current_time - self.hit_timer) >= 200:
self.image.set_alpha(255) self.image.set_alpha(255)
else: else:
self.image.set_alpha(150) self.image.set_alpha(192)
def getTimeRatio(self): def getTimeRatio(self):
return (self.ice_slow_ratio / self.speed) # 目前的机制为:冰冻减速状态与自身速度共同决定行走的时间间隔 return (self.ice_slow_ratio / self.speed) # 目前的机制为:冰冻减速状态与自身速度共同决定行走的时间间隔