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_extensions import override
 8import bascenev1 as bs
 9
10from bascenev1lib.activity.multiteamscore import MultiTeamScoreScreenActivity
11from bascenev1lib.actor.zoomtext import ZoomText
12
13
14class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):
15    """Score screen shown after a draw."""
16
17    default_music = None  # Awkward silence...
18
19    @override
20    def on_begin(self) -> None:
21        bs.set_analytics_screen('Draw Score Screen')
22        super().on_begin()
23        ZoomText(
24            bs.Lstr(resource='drawText'),
25            position=(0, 0),
26            maxwidth=400,
27            shiftposition=(-220, 0),
28            shiftdelay=2.0,
29            flash=False,
30            trail=False,
31            jitter=1.0,
32        ).autoretain()
33        bs.timer(0.35, self._score_display_sound.play)
34        self.show_player_scores(results=self.settings_raw.get('results', None))
class DrawScoreScreenActivity(bascenev1._activity.Activity[bascenev1._player.EmptyPlayer, bascenev1._team.EmptyTeam]):
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))

Score screen shown after a draw.

default_music = None
@override
def on_begin(self) -> None:
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))

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.

Inherited Members
bascenev1lib.activity.multiteamscore.MultiTeamScoreScreenActivity
MultiTeamScoreScreenActivity
show_player_scores
bascenev1._activitytypes.ScoreScreenActivity
transition_time
inherits_tint
inherits_vr_camera_offset
use_fixed_vr_overlay
on_player_join
on_transition_in
bascenev1._activity.Activity
settings_raw
teams
players
announce_player_deaths
is_joining_activity
allow_pausing
allow_kick_idle_players
slow_motion
inherits_slow_motion
inherits_music
inherits_vr_overlay_center
allow_mid_activity_joins
can_show_ad_on_death
paused_text
preloads
lobby
context
globalsnode
stats
on_expire
customdata
expired
playertype
teamtype
retain_actor
add_actor_weak_ref
session
on_player_leave
on_team_join
on_team_leave
on_transition_out
handlemessage
has_transitioned_in
has_begun
has_ended
is_transitioning_out
transition_out
end
create_player
create_team
bascenev1._dependency.DependencyComponent
dep_is_present
get_dynamic_deps