Advertisement
iamcreasy

BombSquad First Mini Game

Mar 4th, 2014
1,353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import bs
  2. import bsTeamGame
  3.  
  4. # how BombSquad knows we exist
  5. def getGames():
  6.     return [HelloWorldGame]
  7.  
  8. class HelloWorldGame(bsTeamGame.TeamGameActivity):
  9.  
  10.     @classmethod
  11.     def getName(c):
  12.         return 'Hello World Game'
  13.  
  14.     @classmethod
  15.     def getDescription(c,sessionType):
  16.         return 'Just a test game.'
  17.  
  18.     def onBegin(self):
  19.         bsTeamGame.TeamGameActivity.onBegin(self)
  20.         # game's starting - let's just set a timer to end it in 5 seconds
  21.         bs.screenMessage("Hello World!  Ending in 5 seconds...")
  22.         self._endTimer = bs.Timer(5000,bs.WeakCall(self._endGame))
  23.  
  24.     def _endGame(self):
  25.         # game's over - set a score for each team and tell the game to end
  26.         results = bsTeamGame.Results()
  27.         for t in self.teams.values(): results.setTeamScore(t,0)
  28.         self.end(results=results)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement