2020 11 27 Review - overlord-supreme/checkers GitHub Wiki


time: 2020-11-27T21:55:00-05
attending:

  • Conner Piece
  • Thomas Trimbur
  • Peter Mangelsdorf

SE-181 Review of Dev Night

Tasks

  • Short Description of Methods
  • Fix Assembly Definitions
  • add animations
  • turn indicator
  • occasional glitching
  • investigate multi-step jumps
  • hop jump just gobble pieces?
  • jump enforcement sorta doesnt work -ish?
  • give it a background
  • gotten out of sync?
    • possible lobby issues?
    • now we cant join each other's rooms?
    • add version number to lobby screen
    • exit game and options do not work (lobby menu)
    • but now it works?
  • cant jump?
  • maybe some kind of indicator on the spaces to indicate their status?
  • need to better communicate forced jump
  • force jump on turn only, -- currently a bug, does not behave this way right now, is instead over eager to force jump
  • win/lose state
  • promotion handled automatically, not networked

Method Descriptions

Board

Board Members

  • SelectableMaterials
    • ui selection material
    • add red/black/white also
  • change black/white to be black/red
    • make sure enums all match
  • event codes
    • is promote code used?
      • no
    • is swap code used?
      • no

Board.Start()

  • builder
    • for loop of only 3
      • (rows of 3, both on top and on bottom, calls bottom half the second half)
      • (handles "second half" at same time)
      • (i is arbitrary)
      • for loop of 8
        • (g is column)
        • if row (i) is even
          • if column is even
            • (g % 2 == 0)
            • add black piece
            • else
              • add red piece
        • if row is odd
          • if column is odd
            • add black piece
            • else
              • add red piece

Board.PromotePiece()

  • not used anywhere

Board.RequestDestroy()

  • looks good, needs summary

Board.DestroyPiece()

  • this is the private, INTERNAL method

Board.MovePiece()

  • handles promotion?
  • why?
  • add to docs

Board.SwapPlayer()

  • eliminated

Board.RequestMove()

  • revise comments are not accurate

Board.checkSpace()

  • MASSIVE
  • no comments
  • parameters
    • x,y: start position
    • direction x,y: that the piece can move in
    • color: player's color
    • originalPiece:
  • if
    • (not out of bounds on x)
    • if
      • (not out of bounds on y)
      • if space is empty
        • just add it as a move and stop
        • else
          • calculate the jump
          • if not out of bounds x
            • if not out of bounds y
              • if is a different color
                • if jump-to space is empty
                  • add it as a move and stop
  • can also return null

Board.GetValidMoves()

  • update the docs
  • flip y direction if other color
  • calls checkSpace
  • forwardLeftMove and forwardRightMove
  • CAUTION: forwardRightMove is INVERTED
  • if king
    • check with INVERTED y direction
  • bool hasJump is used STRICTLY for rules enforcement
  • rules checked at end
  • builds new list with only jump moves

Board.GetAllValidMoves()

  • why
    • need to be able to know which piece can be picked up before it can be picked up
    • ok for lone piece
      • but need to know if another piece can be picked up
  • checks for any jump moves in any other pieces

PlayerManager

PlayerManager (General)

  • is a PUN Object
  • has to do its own turn logic
  • should know its own turn

PlayerManager Member

  • mask: hides non-tiles from raycasting
  • moves: lists moves of a single piece
  • allMoves: lists moves of All pieces
  • currentPieceSelected
  • currentSpaceSelected

PlayerManager.Start()

  • sets color based on lobby master

PlayerManager.OnEvent()

  • HERE is the playerSwapCode!
  • players handle switching as a networked event

PlayerManager.Update()

  • calls raycast

PlayerManager.rayCastMouse()

  • if clicked
    • if not current player
      • return
  • move allMoves generation to lazy/once load
    • (loads every time on an off click)
    • if no piece selected
      • get piece
      • if piece friendly and not null
        • get moves for that piece only
        • compare user actions against them
        • select piece
    • if piece selected
      • wasJump
        • used for jump chaining
      • if jump
        • delete
        • set wasJump
      • if jumped
        • clear moves and recalculate for just the single piece that jumped
          • only add if a jump also
  • add some logic to prevent choosing a piece if another can jump
    • and communicate via ui
  • add some ui to indicate a jump remains
  • always clear moves at end
  • raises swap event at end

PlayerManager.SelectPiece()

  • (has not changed)

PlayerManager.MovePiece()

  • not really used
  • possible delete or add special effects

PlayerManager.DeletePiece()

  • possible delete or add special effects

PlayerManager.SwapPlayer()

  • possible delete or add special effects

Spaces

Space Members

  • x,y: logical posiitons
  • piecePosition: where it spawns
  • currentOccupant: Space
  • isEdge: Unused (delete)
  • color: red, black
  • isOccupied: Unused (delete)
  • getCurrentOccupant: Is used
  • clearCurrentOccupant: Is used
  • setCurrentOccupant: Is used
  • setColor: Unused (delete)

Pieces

Piece Members

  • king: crown
  • pieceColor: enum
  • color:
  • isKing: bool
  • setColor: unused (delete)
  • promotePiece: sets bool and reveals king