Update vanishing_tiles.py

This commit is contained in:
Mr.Paradox 2026-06-10 21:41:40 +05:30 committed by GitHub
parent 2e2ff3656a
commit 4804a55ca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,5 @@
# ba_meta require api 9 # ba_meta require api 9
from __future__ import annotations from __future__ import annotations
from bascenev1lib.gameutils import SharedObjects
import bascenev1 as bs
import babase
import random
from typing import Optional, List, Dict, Any
# Vanishing Tiles - BombSquad Minigame # Vanishing Tiles - BombSquad Minigame
# Tiles disappear one by one. Survive all rounds to win. # Tiles disappear one by one. Survive all rounds to win.
@ -15,12 +10,18 @@ plugman = dict(
description="Tiles disappear gradually. Survive each round to continue. Last player standing wins!", description="Tiles disappear gradually. Survive each round to continue. Last player standing wins!",
external_url="https://discord.gg/sQGDsztQcy", external_url="https://discord.gg/sQGDsztQcy",
authors=[ authors=[
{"name": "Mr.Paradox", "email": "microsoftusergame@gmail.com", "discord": "gaurangbroyo"}, {"name": "Mr.ghosty", "email": "", "discord": "gaurangbroyo"},
{"name": "senchx", "email": "", "discord": "senchx0"}, {"name": "senchx", "email": "", "discord": "senchx0"},
], ],
version="1.0.2", version="2.1.0",
) )
from typing import Optional, List, Dict, Any
import random
import babase
import bascenev1 as bs
from bascenev1lib.gameutils import SharedObjects
class Player(bs.Player['Team']): class Player(bs.Player['Team']):
def __init__(self) -> None: def __init__(self) -> None:
@ -57,19 +58,19 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
def __init__(self, settings: dict) -> None: def __init__(self, settings: dict) -> None:
super().__init__(settings) super().__init__(settings)
self._epic_mode = bool(settings.get('Epic Mode', False)) self._epic_mode: bool = bool(settings.get('Epic Mode', False))
self._show_credits = bool(settings.get('Show Credits', True)) self._show_credits: bool = bool(settings.get('Show Credits', True))
self.default_music = bs.MusicType.EPIC if self._epic_mode else bs.MusicType.SURVIVAL self.default_music = bs.MusicType.EPIC if self._epic_mode else bs.MusicType.SURVIVAL
self._round = 1 self._round: int = 1
self._removing = False self._removing: bool = False
self._game_start_time: Optional[float] = None self._game_start_time: Optional[float] = None
self._tile_nodes: Dict[int, bs.Node] = {} self._tile_nodes: Dict[int, bs.Node] = {}
self._region_nodes: Dict[int, bs.Node] = {} self._region_nodes: Dict[int, bs.Node] = {}
self._present_tile_ids: set[int] = set() self._present_tile_ids: set[int] = set()
self._remove_speed = 1.8 self._remove_speed: float = 1.8
self._collide_mat = bs.Material() self._collide_mat = bs.Material()
self._collide_mat.add_actions(actions=(('modify_part_collision', 'collide', True),)) self._collide_mat.add_actions(actions=(('modify_part_collision', 'collide', True),))
@ -103,7 +104,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
if self._show_credits: if self._show_credits:
self._credit_node = bs.newnode('text', attrs={ self._credit_node = bs.newnode('text', attrs={
'text': 'Made by Mr.Paradox & senchx', 'text': 'Made by Mr.Ghosty',
'scale': 0.7, 'position': (0, 8), 'shadow': 0.8, 'flatness': 1.0, 'scale': 0.7, 'position': (0, 8), 'shadow': 0.8, 'flatness': 1.0,
'color': (1.0, 0.3, 0.8, 1.0), 'h_align': 'center', 'v_attach': 'bottom', 'color': (1.0, 0.3, 0.8, 1.0), 'h_align': 'center', 'v_attach': 'bottom',
}) })
@ -403,9 +404,6 @@ class VanishingTilesMap(bs.Map):
}) })
try:
bs.register_map(VanishingTilesMap)
except Exception:
bs._map.register_map(VanishingTilesMap) bs._map.register_map(VanishingTilesMap)