Documentation for KnightWGMap

class WGLib.KnightWGMap

Extends the SquareGridWGMap. Creates a ‘chessboard map’ in which players gain bonuses for 4-squares & borders are connected like a knight moves in chess.

addBorders()

Adds borders as a knight could attack for a grid created by SquareGridWGMap.createTerritories.()

Args are both ints.

createFunctionGame(filePath, placeKnightFunc, rowHeight=40, colWidth=40)
Be sure to set the board name by hand
createPNG(filePath, rowHeight, colWidth, xOrigin, yOrigin, territoriesDeleted)
Creates a PNG of a chessboard w/knights in dead squares..
createRandomGame(filePath, rowHeight=40, colWidth=40, percentDeadSquares=0.40000000000000002, xOrigin=-1, yOrigin=-1)
returns True if a board was created, False if board creation failed.
placeKnightsSpots(r, c)
X012345678 0 1 x x x 2 3 x x x 4 5 x x x 6 7 x x x 8
setKnightIcons(wkpath, bkpath)

setter TODO: It would be great if rowHeight & colWidth were class members (instance variables), and were set

by the width/height of these images.

Previous topic

Documentation for MazeWGMap