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.

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