bastd.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 TYPE_CHECKING
 8
 9import ba
10from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity
11from bastd.actor.zoomtext import ZoomText
12
13if TYPE_CHECKING:
14    pass
15
16
17class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):
18    """Score screen shown after a draw."""
19
20    default_music = None  # Awkward silence...
21
22    def on_begin(self) -> None:
23        ba.set_analytics_screen('Draw Score Screen')
24        super().on_begin()
25        ZoomText(ba.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).autoretain()
33        ba.timer(0.35, ba.Call(ba.playsound, self._score_display_sound))
34        self.show_player_scores(results=self.settings_raw.get('results', None))
class DrawScoreScreenActivity(ba._activity.Activity[ba._player.EmptyPlayer, ba._team.EmptyTeam]):
18class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):
19    """Score screen shown after a draw."""
20
21    default_music = None  # Awkward silence...
22
23    def on_begin(self) -> None:
24        ba.set_analytics_screen('Draw Score Screen')
25        super().on_begin()
26        ZoomText(ba.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).autoretain()
34        ba.timer(0.35, ba.Call(ba.playsound, self._score_display_sound))
35        self.show_player_scores(results=self.settings_raw.get('results', None))

Score screen shown after a draw.

default_music: ba._music.MusicType | None = None
def on_begin(self) -> None:
23    def on_begin(self) -> None:
24        ba.set_analytics_screen('Draw Score Screen')
25        super().on_begin()
26        ZoomText(ba.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).autoretain()
34        ba.timer(0.35, ba.Call(ba.playsound, self._score_display_sound))
35        self.show_player_scores(results=self.settings_raw.get('results', None))

Called once the previous ba.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
bastd.activity.multiteamscore.MultiTeamScoreScreenActivity
MultiTeamScoreScreenActivity
show_player_scores
ba._activitytypes.ScoreScreenActivity
transition_time
inherits_tint
inherits_vr_camera_offset
use_fixed_vr_overlay
on_player_join
on_transition_in
ba._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
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
ba._dependency.DependencyComponent
dep_is_present
get_dynamic_deps