2 class AbstractGameBoard( object ):
3 def __init__( self
, gamestate
):
6 def GetRelativePixel( self
, start_pos
, facing_dir
,
7 offset_fwd
, offset_right
):
8 """Given a position to stand in the arena, and a direction to face,
9 return the status (0 for empty, >0 for non-empty) of a pixel that
10 is offset_fwd pixels in front, and offset_right pixels to the right
11 (negative values may be used to go backwards or left respectively).
12 Pixels outside the arena also return >0."""
15 def GetPlayerPositions( self
, pos_to_exclude
= None ):
16 """Returns a list of pairs (pos, dir) for each player on screen.
17 Excludes the player at the position specified if pos_to_exclude
21 def TurnRight( self
, direction
):
22 """Return the direction found by turning 90 degrees right from
23 the supplied direction."""
26 def TurnLeft( self
, direction
):
27 """Return the direction found by turning 90 degrees left from
28 the supplied direction."""