bascenev1lib.activity.drawscore

Functionality related to the draw screen.

 1# Released under the MIT License. See LICENSE for details.
 2#
 3"""Functionality related to the draw screen."""
 4
 5from __future__ import annotations
 6
 7from typing import override
 8
 9import bascenev1 as bs
10
11from bascenev1lib.activity.multiteamscore import MultiTeamScoreScreenActivity
12from bascenev1lib.actor.zoomtext import ZoomText
13
14
15class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):
16    """Score screen shown after a draw."""
17
18    default_music = None  # Awkward silence...
19
20    @override
21    def on_begin(self) -> None:
22        bs.set_analytics_screen('Draw Score Screen')
23        super().on_begin()
24        ZoomText(
25            bs.Lstr(resource='drawText'),
26            position=(0, 0),
27            maxwidth=400,
28            shiftposition=(-220, 0),
29            shiftdelay=2.0,
30            flash=False,
31            trail=False,
32            jitter=1.0,
33        ).autoretain()
34        bs.timer(0.35, self._score_display_sound.play)
35        self.show_player_scores(results=self.settings_raw.get('results', None))
class DrawScoreScreenActivity(bascenev1._activity.Activity[bascenev1._player.EmptyPlayer, bascenev1._team.EmptyTeam]):
16class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):
17    """Score screen shown after a draw."""
18
19    default_music = None  # Awkward silence...
20
21    @override
22    def on_begin(self) -> None:
23        bs.set_analytics_screen('Draw Score Screen')
24        super().on_begin()
25        ZoomText(
26            bs.Lstr(resource='drawText'),
27            position=(0, 0),
28            maxwidth=400,
29            shiftposition=(-220, 0),
30            shiftdelay=2.0,
31            flash=False,
32            trail=False,
33            jitter=1.0,
34        ).autoretain()
35        bs.timer(0.35, self._score_display_sound.play)
36        self.show_player_scores(results=self.settings_raw.get('results', None))

Score screen shown after a draw.

default_music = None
@override
def on_begin(self) -> None:
21    @override
22    def on_begin(self) -> None:
23        bs.set_analytics_screen('Draw Score Screen')
24        super().on_begin()
25        ZoomText(
26            bs.Lstr(resource='drawText'),
27            position=(0, 0),
28            maxwidth=400,
29            shiftposition=(-220, 0),
30            shiftdelay=2.0,
31            flash=False,
32            trail=False,
33            jitter=1.0,
34        ).autoretain()
35        bs.timer(0.35, self._score_display_sound.play)
36        self.show_player_scores(results=self.settings_raw.get('results', None))

Called once the previous Activity has finished transitioning out.

At this point the activity's initial players and teams are filled in and it should begin its actual game logic.