Skip to content

Commit

Permalink
v5.0.0-alpha.255: Default Animation with Sound Effects + Quarto Anima…
Browse files Browse the repository at this point in the history
…tion (#94)

* 6 Men's Morris Board SVGs

* Chomp Poison Square SVG

* Add support for naiveInterpolate default animation

* Quarto CustomGUI Complete Minus Sounds

* Add New Sound Effects

* Finish default sfx
  • Loading branch information
cameroncheung00 authored Aug 28, 2023
1 parent 0aa756e commit 5842607
Show file tree
Hide file tree
Showing 28 changed files with 158 additions and 95 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"preview:https": "serve dist",
"reinstall": "rm -rf node_modules; yarn; vue-tsc --noEmit"
},
"version": "5.0.0-alpha.254"
"version": "5.0.0-alpha.255"
}
8 changes: 2 additions & 6 deletions src/components/units/GameBody/CustomGUIQuarto.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<g v-if="isInitial">
<g v-if="!animationPlaying">
<rect x="2.5" y="2.5" width="95" height="95" rx="4" ry="4" opacity="0.99" fill="#FFFFFF"/>
<rect x="2.5" y="2.5" width="95" height="95" rx="4" ry="4" fill="#FFFFFF"/>
<text x="25" y="10" fill="black" class="small">Choose a Piece for the</text>
<text x="24.5" y="15" fill="black" class="small">Second Player to Place</text>

Expand Down Expand Up @@ -107,7 +107,7 @@
</g>

<g v-if="isPlacing && !animationPlaying">
<text x="0" y="116.5" style="stroke:black;stroke-width:0.5;fill:black" class="big">Placing:</text>
<text x="0" y="116.5" style="font: 12px sans-serif;stroke:black;stroke-width:0.5;fill:black">Placing:</text>
</g>
</svg>
</template>
Expand Down Expand Up @@ -211,10 +211,6 @@
font: 5px sans-serif;
}
.big {
font: 12px sans-serif;
}
@keyframes pulsing-token {
0% { transform: scale(1); }
100% { transform: scale(1.1); }
Expand Down
2 changes: 1 addition & 1 deletion src/components/units/GameBody/ImageAutoGUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
};
let matches;
if ((matches = nextMoveData.move.match(/^A_([a-zA-Z0-9-\*])_([0-9]+)*/))) {
if ((matches = nextMoveData.move.match(/^A_([a-zA-Z0-9-])_([0-9]+)*/))) {
tokens.push({
token: matches[1],
to: parseInt(matches[2]),
Expand Down
Binary file removed src/models/sounds/Bee1.mp3
Binary file not shown.
Binary file removed src/models/sounds/Bee2.mp3
Binary file not shown.
Binary file removed src/models/sounds/GeneralSlide.mp3
Binary file not shown.
Binary file removed src/models/sounds/O.mp3
Binary file not shown.
Binary file removed src/models/sounds/Snake2.mp3
Binary file not shown.
Binary file removed src/models/sounds/X.mp3
Binary file not shown.
Binary file added src/models/sounds/animals/bee.mp3
Binary file not shown.
File renamed without changes.
Binary file added src/models/sounds/animals/dog.mp3
Binary file not shown.
File renamed without changes.
Binary file added src/models/sounds/animals/fox.mp3
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file added src/models/sounds/chomp/Munch.mp3
Binary file not shown.
Binary file added src/models/sounds/general/place.mp3
Binary file not shown.
Binary file added src/models/sounds/general/remove.mp3
Binary file not shown.
Binary file added src/models/sounds/general/slide.mp3
Binary file not shown.
Binary file added src/models/sounds/general/slideThenRemove.mp3
Binary file not shown.
Binary file added src/models/sounds/ttt/O.mp3
Binary file not shown.
Binary file added src/models/sounds/ttt/X.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/scripts/apis/gamesCrafters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export type AutoGUIv2Theme = {
lineWidth: number;
defaultMoveTokenRadius: number;
centers: Array<AutoGUIv2Coordinate>;
piecesToBeIntroduced: string;
sounds: Record<string, string>;
animationType: string;
animationWindow: Array<number>;
pieces: Record<string, AutoGUIv2Token>;
Expand Down
16 changes: 11 additions & 5 deletions src/scripts/gamesmanUni/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,23 @@ export const runMove = async (app: Types.App, payload: { move: string }) => {
);
app.currentMatch.rounds.push(deepcopy(app.currentMatch.round));
var updatedApp = null;
while (!updatedApp) {
for (var attempts = 0; attempts < 5; attempts++) {
updatedApp = await loadPosition(app, {
gameType: app.currentMatch.gameType,
gameId: app.currentMatch.gameId,
variantId: app.currentMatch.variantId,
position: moveObj.position
});
};
if (updatedApp) break;
}
await new Promise(r => setTimeout(r, animationDuration));
app.currentMatch.animationPlaying = false;
animationEpilogue(app.currentMatch);
if (!updatedApp) {
alert("Failed to load next position after 5 attempts. Resetting to previous position.");
return app;
}

const updatedPosition = {
...updatedApp.
gameTypes[app.currentMatch.gameType].
Expand All @@ -356,9 +365,6 @@ export const runMove = async (app: Types.App, payload: { move: string }) => {
position
]
};
await new Promise(r => setTimeout(r, animationDuration));
app.currentMatch.animationPlaying = false;
animationEpilogue(app.currentMatch);
app.currentMatch.moveHistory += moveHistoryDelim + (moveObj.moveName ? moveObj.moveName : moveObj.move);
let posArr = updatedPosition.position.split('_');
if (posArr.length === 5 && posArr[0] === 'R') {
Expand Down
223 changes: 142 additions & 81 deletions src/scripts/gamesmanUni/moveAnimation.ts

Large diffs are not rendered by default.

0 comments on commit 5842607

Please sign in to comment.