Skip to content

Commit

Permalink
Add src temporary, structure notes, and standard moves
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-the-dev committed Feb 4, 2022
1 parent 369e3a6 commit fd79741
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
46 changes: 46 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Design and Structure

Rough draft to get the overall ideas out.

Board
- makeGrid
- fillGrid
- fillCards
- movePiece
- validMove
- isEmpty
- possibleMoves
- currentCards

Piece
- color
- currentPosition
- moveToStone(master)
- moveToStream(master)

Player
- color
- makeMove

Game
- swapTurn
- swapMoveCards
- play (until winStone || winStream)
- quitEarly
- dealCardsAgain (board?)

Possible?
- selectedCard
- selectedPawn
- studentPawn
- masterPawn
- shrineTile

View
- tileColor
- shrineTile
- cardFlip
- cardMove
- pawnMove
- captureMaster
- captureStudent
35 changes: 35 additions & 0 deletions srcTemp/board.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class Board {
constructor() {
this.grid = Board.makeGrid();
}

isEmpty(pos) {

}

// movePiece() ?



makeGrid() {
let grid = [];
for (let i = 0; i < 5; i++) {
grid.push([]);
for (let j = 0; j < 5; j++) {
grid[i].push(null);
}
}
return grid;
}

makeMoveCards() {

}
}

module.exports = Board;




// makeGrid as static method? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#static_methods_and_properties
23 changes: 23 additions & 0 deletions srcTemp/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Grid 5x5

// Card Deck
// let pos = [row, col];

let tiger = [[-1, 0], [2, 0]]; // tiger
let dragon = [[-1, 1], [-1, -1], [1, 2], [1, -2]]; // dragon
let frog = [[1, -1], [0, -2], [-1, 1]]; // frog
let rabbit = [[-1, -1], [1, 1], [0, 2]]; // rabbit
let crab = [[0, -2], [1, 0], [0, 2]]; // crab
let elephant = [[0, -1], [1, -1], [0, 1], [1, 1]]; // elephant
let goose = [[0, -1], [1, -1], [0, 1], [-1, 1]]; // goose
let rooster = [[0, -1], [-1, -1], [0, 1], [1, 1]]; // rooster
let monkey = [[1, -1], [-1, -1], [-1, 1], [1, 1]]; // monkey
let mantis = [[1, -1], [1, 1], [-1, 0]]; // mantis
let horse = [[0, -1], [-1, 0], [1, 0]]; // horse
let ox = [[0, 1], [-1, 0], [1, 0]]; // ox
let crane = [[1, 0], [-1, -1], [-1, 1]]; // crane
let boar = [[1, 0], [0, -1], [0, 1]]; // boar
let eel = [[1, -1], [-1, -1], [0, 1]]; // eel
let cobra = [[0, -1], [1, 1], [-1, 1]]; // cobra


6 changes: 6 additions & 0 deletions srcTemp/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document.addEventListener("DOMContentLoaded", () => {



})

Empty file added srcTemp/piece.js
Empty file.
1 change: 1 addition & 0 deletions srcTemp/player.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// maybe necessary?

0 comments on commit fd79741

Please sign in to comment.