добавил награды из игры аркадия

This commit is contained in:
2023-01-28 12:27:23 +07:00
parent ca9e0add34
commit e8be151a72
+28
View File
@@ -54,6 +54,7 @@ class Game:
screen_move.blit(text, (70, 540))
if self.scores == 10:
print("Прекол")
self.get_reward(10)
def side_change(self): # Изменение стороны и проверка
if not self.right:
@@ -74,6 +75,8 @@ class Game:
self.speed += 10
else:
print("Не прекол")
scores = self.scores
self.get_reward(scores)
global running
running = False
@@ -96,6 +99,31 @@ class Game:
self.line = pg.transform.rotate(self.line, self.corner)
self.corner -= self.speed * self.clock.tick(50000) / 10000
@staticmethod
def get_reward(scope):
scope_mass = {
"1": 5,
"2": 10,
"3": 20,
"4": 35,
"5": 50,
"6": 75,
"7": 100,
"8": 150,
"9": 200,
"10": 1000
}
from modules.DB import UseDB
db = UseDB("game")
db.update_document(
{
"save.name": "start"
},
{
"money": db.find_document({})[0]["money"] + scope_mass[str(scope)]
}
)
pg.init()
size = 600, 600