MCPcopy
hub / github.com/CharlesPikachu/Games / status

Method status

cpgames/core/games/angrybirds/modules/gamelevels.py:27–35  ·  view source on GitHub ↗
(self, pigs, birds)

Source from the content-addressed store, hash-verified

25 self.level_pointer = 1
26 '''游戏状态'''
27 def status(self, pigs, birds):
28 status_codes = {
29 'gaming': 0,
30 'failure': 1,
31 'victory': 2,
32 }
33 if len(pigs) == 0: return status_codes['victory']
34 elif len(birds) == 0: return status_codes['failure']
35 else: return status_codes['gaming']
36 '''所有元素是否已经静止'''
37 def still(self, sprites_list, threshold=0.15):
38 for sprite in sprites_list:

Callers 1

startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected