Merge branch 'main' of https://github.com/Ta180m/BSX
This commit is contained in:
commit
6306da1abd
3 changed files with 13 additions and 10 deletions
12
README.md
12
README.md
|
@ -1,9 +1,11 @@
|
||||||
# BSX
|
# BSX
|
||||||
The card game BS, but better! Currently under development.
|
The card game BS, but better!
|
||||||
|
|
||||||
## Production deployment
|
## Getting started
|
||||||
|
`git clone` this repository, then run `npm install` in `front` and `back`. You may have to run it multiple times for it to pull in all dependencies.
|
||||||
Edit the environmental variables in `./env` and use the script `./run`.
|
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
You can use `NEXT_PUBLIC_BACK_HOST=localhost:4000 npm run dev` to run the frontend and `PORT=4000 node dist/index.js` to run the backend after building it with `npm run build`.
|
You can use `NEXT_PUBLIC_BACK_HOST=localhost:4000 npm run dev` to run the frontend and `PORT=4000 node dist/index.js` to run the backend after building it with `npm run build`. You could also just run `NEXT_PUBLIC_BACK_HOST='https://server.exozy.me' npm run dev` if you are only developing the frontend and connect to the public backend server.
|
||||||
|
|
||||||
|
## Production deployment
|
||||||
|
Edit the environmental variables in `./env` and use the script `./run`.
|
||||||
|
|
|
@ -110,11 +110,11 @@ export default class Game {
|
||||||
}
|
}
|
||||||
while (this.lastPlayed > 0) { // Phase 2
|
while (this.lastPlayed > 0) { // Phase 2
|
||||||
await this.flip();
|
await this.flip();
|
||||||
this.lastPlayed--;
|
|
||||||
if (this.phase === 3 as number) { // Oops, flipped over a red card!
|
if (this.phase === 3 as number) { // Oops, flipped over a red card!
|
||||||
await this.giveup(); // The player who called BS won and now the challenged player must give up a card!
|
await this.giveup(); // The player who called BS won and now the challenged player must give up a card!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.lastPlayed--;
|
||||||
}
|
}
|
||||||
this.phase = 3;
|
this.phase = 3;
|
||||||
await this.giveup(); // The player who called BS won and now they must give up a card!
|
await this.giveup(); // The player who called BS won and now they must give up a card!
|
||||||
|
|
|
@ -18,9 +18,7 @@ interface GameState {
|
||||||
const rankStrs = ['', 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
|
const rankStrs = ['', 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
|
||||||
const suitChars = ['♣', '♦', '♥', '♠'];
|
const suitChars = ['♣', '♦', '♥', '♠'];
|
||||||
|
|
||||||
const rules = `Welcome to BSX!
|
const rules = `There are only 5 simple rules!
|
||||||
|
|
||||||
There are only 5 simple rules!
|
|
||||||
|
|
||||||
1. You will first be dealt 5 cards.
|
1. You will first be dealt 5 cards.
|
||||||
|
|
||||||
|
@ -88,6 +86,9 @@ export default function Game() {
|
||||||
if (!loggedIn) {
|
if (!loggedIn) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<h2>
|
||||||
|
Welcome to BSX!
|
||||||
|
</h2>
|
||||||
<div>
|
<div>
|
||||||
{rules}
|
{rules}
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,7 +159,7 @@ export default function Game() {
|
||||||
</div>
|
</div>
|
||||||
{`Rearrange your card stack from top to bottom!`}
|
{`Rearrange your card stack from top to bottom!`}
|
||||||
<div>
|
<div>
|
||||||
<p>Your cards:</p>
|
<p>Your cards stack:</p>
|
||||||
{gameState.cards.map((card, i) => (
|
{gameState.cards.map((card, i) => (
|
||||||
<label key={card.rank+' '+card.suit}>
|
<label key={card.rank+' '+card.suit}>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue