bascenev1lib package¶
Library of stuff using the bascenev1 api: games, actors, etc.
Subpackages¶
Submodules¶
bascenev1lib.gameutils module¶
Various utilities useful for gameplay.
Bases:
object
Various common components for use in games.
Objects contained here are created on-demand as accessed and shared by everything in the current activity. This includes things such as standard materials.
A bascenev1.Material applied to explosion shapes, punch shapes, etc. An object not wanting to receive impulse/etc messages can disable collisions against this material.
A bascenev1.Material that sends a ba.DieMessage() to anything that touches it; handy for terrain below a cliff, etc.
Anything that can be ‘walked on’ should have this bascenev1.Material applied; generally just terrain and whatnot. A character will snap upright whenever touching something with this material so it should not be applied to props, etc.
Fetch/create the instance of this class for the current activity.
A bascenev1.Material that should be applied to any small, normal, physical objects such as bombs, boxes, players, etc. Other materials often check for the presence of this material as a prerequisite for performing certain actions (such as disabling collisions between initially-overlapping objects)
A bascenev1.Material; collision shapes used for picking things up will have this material applied. To prevent an object from being picked up, you can add a material that disables collisions against things containing this material.
a bascenev1.Material to be applied to player parts. Generally, materials related to the process of scoring when reaching a goal, etc will look for the presence of this material on things that hit them.
A bascenev1.Material with a very low friction/stiffness/etc that can be applied to invisible ‘railings’ useful for gently keeping characters from falling off of cliffs.
A bascenev1.Material used for non-physical collision shapes (regions); collisions can generally be allowed with this material even when initially overlapping since it is not physical.
bascenev1lib.maps module¶
Standard maps.
- class bascenev1lib.maps.BigG[source]¶
Bases:
Map
Large G shaped map for racing
- defs: Any = <module 'bascenev1lib.mapdata.big_g' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/big_g.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Big G'¶
- class bascenev1lib.maps.Bridgit[source]¶
Bases:
Map
Map with a narrow bridge in the middle.
- dataname = 'bridgit'¶
- defs: Any = <module 'bascenev1lib.mapdata.bridgit' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/bridgit.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Bridgit'¶
- class bascenev1lib.maps.Courtyard[source]¶
Bases:
Map
A courtyard-ish looking map for co-op levels.
- defs: Any = <module 'bascenev1lib.mapdata.courtyard' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/courtyard.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- is_point_near_edge(point: Vec3, running: bool = False) bool [source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Courtyard'¶
- class bascenev1lib.maps.CragCastle[source]¶
Bases:
Map
A lovely castle map.
- defs: Any = <module 'bascenev1lib.mapdata.crag_castle' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/crag_castle.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Crag Castle'¶
- class bascenev1lib.maps.DoomShroom[source]¶
Bases:
Map
A giant mushroom. Of doom!
- defs: Any = <module 'bascenev1lib.mapdata.doom_shroom' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/doom_shroom.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- is_point_near_edge(point: Vec3, running: bool = False) bool [source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Doom Shroom'¶
- class bascenev1lib.maps.FootballStadium[source]¶
Bases:
Map
Stadium map for football games.
- defs: Any = <module 'bascenev1lib.mapdata.football_stadium' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/football_stadium.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- is_point_near_edge(point: Vec3, running: bool = False) bool [source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Football Stadium'¶
- class bascenev1lib.maps.HappyThoughts[source]¶
Bases:
Map
Flying map.
- defs: Any = <module 'bascenev1lib.mapdata.happy_thoughts' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/happy_thoughts.py'>¶
- classmethod get_music_type() MusicType [source]¶
Return a music-type string that should be played on this map.
If None is returned, default music will be used.
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Happy Thoughts'¶
- class bascenev1lib.maps.HockeyStadium[source]¶
Bases:
Map
Stadium map used for ice hockey games.
- defs: Any = <module 'bascenev1lib.mapdata.hockey_stadium' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/hockey_stadium.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Hockey Stadium'¶
- class bascenev1lib.maps.LakeFrigid[source]¶
Bases:
Map
An icy lake fit for racing.
- defs: Any = <module 'bascenev1lib.mapdata.lake_frigid' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/lake_frigid.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Lake Frigid'¶
- class bascenev1lib.maps.MonkeyFace[source]¶
Bases:
Map
Map sorta shaped like a monkey face; teehee!
- defs: Any = <module 'bascenev1lib.mapdata.monkey_face' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/monkey_face.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Monkey Face'¶
- class bascenev1lib.maps.Rampage[source]¶
Bases:
Map
Wee little map with ramps on the sides.
- defs: Any = <module 'bascenev1lib.mapdata.rampage' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/rampage.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- is_point_near_edge(point: Vec3, running: bool = False) bool [source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Rampage'¶
- class bascenev1lib.maps.Roundabout[source]¶
Bases:
Map
CTF map featuring two platforms and a long way around between them
- defs: Any = <module 'bascenev1lib.mapdata.roundabout' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/roundabout.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Roundabout'¶
- class bascenev1lib.maps.StepRightUp[source]¶
Bases:
Map
Wide stepped map good for CTF or Assault.
- defs: Any = <module 'bascenev1lib.mapdata.step_right_up' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/step_right_up.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Step Right Up'¶
- class bascenev1lib.maps.ThePad[source]¶
Bases:
Map
A simple square shaped map with a raised edge.
- defs: Any = <module 'bascenev1lib.mapdata.the_pad' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/the_pad.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'The Pad'¶
- class bascenev1lib.maps.TipTop[source]¶
Bases:
Map
A pointy map good for king-of-the-hill-ish games.
- defs: Any = <module 'bascenev1lib.mapdata.tip_top' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/tip_top.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Tip Top'¶
- class bascenev1lib.maps.TowerD[source]¶
Bases:
Map
Map used for runaround mini-game.
- defs: Any = <module 'bascenev1lib.mapdata.tower_d' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/tower_d.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- is_point_near_edge(point: Vec3, running: bool = False) bool [source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Tower D'¶
- class bascenev1lib.maps.ZigZag[source]¶
Bases:
Map
A very long zig-zaggy map
- defs: Any = <module 'bascenev1lib.mapdata.zig_zag' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/zig_zag.py'>¶
- classmethod get_preview_texture_name() str [source]¶
Return the name of the preview texture for this map.
- name = 'Zigzag'¶
bascenev1lib.tutorial module¶
Wrangles the game tutorial sequence.
- class bascenev1lib.tutorial.ButtonPress(button: str, delay: int = 0, release: bool = True, release_delay: int = 0)[source]¶
Bases:
object
- run(a: TutorialActivity) None [source]¶
- class bascenev1lib.tutorial.ButtonRelease(button: str, delay: int = 0)[source]¶
Bases:
object
- run(a: TutorialActivity) None [source]¶
- class bascenev1lib.tutorial.TutorialActivity(settings: dict | None = None)[source]¶
-
- on_begin() None [source]¶
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.
- on_player_join(player: Player) None [source]¶
Called when a player joins the activity.
(including the initial set of players)
- on_transition_in() None [source]¶
Called when the activity is first becoming visible.
Upon this call, the activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous activity up until
on_begin()
is called.