diff --git a/public/Game Board.png b/public/Game Board.png new file mode 100644 index 0000000..47acc25 Binary files /dev/null and b/public/Game Board.png differ diff --git a/public/blue-team.png b/public/blue-team.png new file mode 100644 index 0000000..b7c785c Binary files /dev/null and b/public/blue-team.png differ diff --git a/public/blueteamback.png b/public/blueteamback.png new file mode 100644 index 0000000..d8f9890 Binary files /dev/null and b/public/blueteamback.png differ diff --git a/public/blueteambigboard.png b/public/blueteambigboard.png new file mode 100644 index 0000000..9966875 Binary files /dev/null and b/public/blueteambigboard.png differ diff --git a/public/clan-logo.png b/public/clan-logo.png new file mode 100644 index 0000000..31f3ae2 Binary files /dev/null and b/public/clan-logo.png differ diff --git a/public/clanwarlogo.png b/public/clanwarlogo.png new file mode 100644 index 0000000..74d0c48 Binary files /dev/null and b/public/clanwarlogo.png differ diff --git a/public/redteam.png b/public/redteam.png new file mode 100644 index 0000000..187e4a4 Binary files /dev/null and b/public/redteam.png differ diff --git a/public/redteambigboard.png b/public/redteambigboard.png new file mode 100644 index 0000000..0eb953f Binary files /dev/null and b/public/redteambigboard.png differ diff --git a/public/redteamboard.png b/public/redteamboard.png new file mode 100644 index 0000000..37aa963 Binary files /dev/null and b/public/redteamboard.png differ diff --git a/src/components/game/index.tsx b/src/components/game/index.tsx new file mode 100644 index 0000000..74ff271 --- /dev/null +++ b/src/components/game/index.tsx @@ -0,0 +1,290 @@ +import { message } from 'antd'; +import react from 'react' +import './style.css' + +interface IPostion{ + x: number; + y: number; +} + +const myCard =
+ +const teammeitCard = +const enemy = + + +const hunt = + + +const hint = + +function choose(choices: any[]) { + var index = Math.floor(Math.random() * choices.length); + return choices[index]; +} + +function checkPosition( + position: IPostion, + playerCords: IPostion, + enemiesCords: IPostion[], + teammeitCords: IPostion[] +) { + if (position.x < 0 || position.x > 10) { + return false + } + if (position.y < 0 || position.y > 10) { + return false + } + if (position.x == playerCords.x && position.y == playerCords.y) { + return false + } + for (var i = 0; i < enemiesCords.length; ++i) { + if (position.x == enemiesCords[i].x && position.y == enemiesCords[i].y){ + return false + } + } + for (var i = 0; i < teammeitCords.length; ++i) { + if (position.x == teammeitCords[i].x && position.y == teammeitCords[i].y){ + return false + } + } + return true; +} + +const hunt_position = {x: 6, y: 9} + +function getAvailableMoveCords( + playerCords: IPostion, + enemiesCords: IPostion[], + teammeitCords: IPostion[], + myCords: IPostion) { + var hintPositions:IPostion[] = []; + if (checkPosition( + {x: myCords.x, y: myCords.y+1}, + playerCords, + enemiesCords, + teammeitCords + )){ + hintPositions.push({x: myCords.x, y: myCords.y+1}) + } + if (checkPosition( + {x: myCords.x+1, y: myCords.y}, + playerCords, + enemiesCords, + teammeitCords + )){ + hintPositions.push({x: myCords.x+1, y: myCords.y}) + } + if (checkPosition( + {x: myCords.x, y: myCords.y-1}, + playerCords, + enemiesCords, + teammeitCords + )){ + hintPositions.push({x: myCords.x, y: myCords.y-1}) + } + if (checkPosition( + {x: myCords.x-1, y: myCords.y}, + playerCords, + enemiesCords, + teammeitCords + )){ + hintPositions.push({x: myCords.x-1, y: myCords.y}) + } + return hintPositions +} + +export const Game: react.FC = () => { + const [huntVisible, setHuntVisible] = react.useState
+
+
+
+
+
+
+
+
+
+
+
+
+
+