Takes a single arbitrary object as an argument. Which are always explicitly created and destroyed regardless of how manyĪnother key feature of bs.Actor is its handleMessage() method, which This is in contrast to the behavior of the more low level bs.Nodes, # (provided nothing else is holding a reference to it) Self.flag = bs.Flag(position=(0,10,0)) # later, destroy the flag. Reference to them disappears, so you can use logic such as: # create a flag in our activity (killing off or transitioning out their nodes) when the last python One key feature of actors is that they generally 'die' Some example actors include bs.Bomb, bs.Flag, and bs.Spaz. If bs.Nodes represent cells, think of bs.Actors as organs. More bs.Nodes, bits of game media, etc, along with the associated logic to Time even if finish() has not been called.Īctors are high level organizational entities that generally manage one or onTransitionOut()Ĭalled when your activity starts transitioning out and a newĪctivity is on the way in. Until bs.Activity.onBegin() is called they are still ownedīy the previous activity up until this point. It does not yet have access to bs.Players or bs.Teams, however, It should fade in backgrounds, start playing music, etc. onTransitionIn()Ĭalled when your activity is first becoming visible (including the initial set of them).' onTeamLeave()Ĭalled when a bs.Team leaves the activity. onTeamJoin()Ĭalled when a new bs.Team enters the activity onPlayerLeave()Ĭalled when a player is leaving the activity. Purpose in life is to hit zero references and die so the next activityĬalled for all new bs.Players (including the initial set of them). If your activity has created anything explicitly that may be retainingĪ strong reference to the activity and preventing it from dying, you onFinalize()Ĭalled when your activity is being finalized. Whatever is relevant to keep the game going. In this case the player should be given an extra life or This is called if a game supports and offers a continue and the playerĪccepts. Player to continue (or timeout) onBegin()Ĭalled once the previous bs.Activity has finished transitioning out.Īt this point the activity's initial players and teams are filled inĪnd it should begin its actual game logic. Returns whether or not this activity is currently waiting for the Returns whether onTransitionOut() has been called for this activity. Run, etc, and the activity should be considered to be a 'zombie'. The activity is set as finalized when shutting down.Īt this point no new nodes, timers, etc should be made, Returns whether onTransitionIn() has been called for this activity. Returns whether end() has been called for this activity. Returns whether onBegin() has been called for this activity. General message handling can be passed any message object. If the session no longer exists, returns None. Returns the bs.Session this activity belongs to. This time, unless 'force' is True, in which case the new results Further calls to end() will be ignored up until 'delay' is the time delay before the activity actually ends If continues are allowed, prompts the player to purchase a continueĪnd calls either endGame or continueGame depending on the result end()Įnd(self, results=None, delay=0, force=False)Ĭommences activity shutdown and delivers results to the bs.Session. Their constructor, but none of it should actually be used until they
![bombsquad api bombsquad api](https://www.froemling.net/wp-content/uploads/2011/05/bsIcon-150x150.png)
'settings' should be a dict of key/value pairs specific to the activity.Īctivities should preload as much of their media/etc as possible in
![bombsquad api bombsquad api](https://www.froemling.net/wp-content/uploads/2018/03/merch-lineup-2-1.jpg)
The activity will not be actually run until bs.tActivity() Methods:, continueOrEndGame(), end(), getSession(), handleMessage(), hasBegun(), hasEnded(), hasTransitionedIn(), isFinalized(), isTransitioningOut(), isWaitingForContinue(), onBegin(), onContinue(), onFinalize(), onPlayerJoin(), onPlayerLeave(), onTeamJoin(), onTeamLeave(), onTransitionIn(), onTransitionOut() Ĭreates an activity in the current bs.Session. Their own team in teams mode there are always 2 teams regardless of (at least in free-for-all mode where every player gets OnBegin() is called and is updated automatically as players join or The settings dict passed in when the activity was made. This gets populated justīefore onBegin() is called and is updated automatically as players Attributes: players, settings, teams players A bs.Session has one 'current' Activity atĪny time, though their existence can overlap during transitions. Happy modding!įunctions by Category: Game Flow Functions: If you come across something you feel should be included here or could be better explained, please let me know.
![bombsquad api bombsquad api](https://www.froemling.net/wp-content/uploads/2011/05/keepaway-1024x640.png)
Which are the ones most relevant to modding BombSquad. This page documents the Python classes and functions in the 'bs' module, last updated on for BombSquad version 1.4.153 build 14373 Since version 1.5, all BombSquad documentation can be found at.