This module implement a simple bomb system for Bomberman game.
A Class to define a Bomberman bomb. This bomb have no information about his owner, because it’s aimed to be store in the Player.Player class.
This class can be used both by the client and the server.
the dimension of explosion.
the timer of the bomb.
The power of the bomb
Just decrease the timer of the bomb, [toc] is the time spent during ticking. self.timer<=0 is returned. Allow the following shortcut :
>>> if board[i,j].bomb.tic:
>>> print 'My bomb at place (%i,%i) is exploding !!' % (i,j)
>>> game.make_explosion(board[i,j].bomb) # a toy example.
>>> else:
>>> print 'Hourra, the bomb at place (%i,%i) is not exploding !!' % (i,j)
Bases: Bomb.BombNoOwner
A Class to define a Bomberman bomb. It is just a BombNoOwner with an extra owner attribute.
This class can be used both by the client and the server.
Simple constructor of a bomb. The [owner] have to be given, the others paramaters can be omitted. [owner] is used to be a Player.Player instance, but formally coulb be anything.
the indicator of the player which droped the bomb.
the dimension of explosion.
the timer of the bomb.
The power of the bomb