Skip to content

Commit

Permalink
don't show the congrats popup as often
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcosulich committed Jul 10, 2023
1 parent 465d7cb commit a034279
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {

display: (board) => {
const { packedSpaces } = board;
// const packedSpaces = "7066750781832232977"
const allColors = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13].map(i => `color${i}`);
const tiles = eByClass('tile');
let topTile = 1;
Expand Down Expand Up @@ -665,7 +666,8 @@ function handleResult(newBoard, direction) {
confetti.run();

setTimeout(() => {
if (
if (topTile < 9) return;
if (
topTile >= leaderboard.minTile() &&
newBoard.score > leaderboard.minScore()
) {
Expand Down
1 change: 1 addition & 0 deletions js/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {

display: (board) => {
const { packedSpaces } = board;
// const packedSpaces = "7066750781832232977"
const allColors = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13].map(i => `color${i}`);
const tiles = eByClass('tile');
let topTile = 1;
Expand Down
3 changes: 2 additions & 1 deletion js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ function handleResult(newBoard, direction) {
confetti.run();

setTimeout(() => {
if (
if (topTile < 9) return;
if (
topTile >= leaderboard.minTile() &&
newBoard.score > leaderboard.minScore()
) {
Expand Down
18 changes: 18 additions & 0 deletions move/sources/game_board_8192.move
Original file line number Diff line number Diff line change
Expand Up @@ -1290,4 +1290,22 @@ module ethos::game_board_8192 {
TILE4, TILE4, TILE8, TILE2
]), 1);
}

// #[test]
// fun test__valid_move() {
// let game_board = GameBoard8192 {
// packed_spaces: 7066750781832232977,
// score: 0,
// last_tile: vector[],
// top_tile: TILE1024,
// game_over: false
// };
// move_direction(&mut game_board, DOWN, vector[1,2,3,4,5,6]);
// assert!(game_board_matches(&game_board, vector[
// TILE32, EMPTY, EMPTY, TILE2,
// TILE8, EMPTY, EMPTY, EMPTY,
// TILE2, TILE8, EMPTY, EMPTY,
// TILE4, TILE4, TILE8, TILE2
// ]), 1);
// }
}

0 comments on commit a034279

Please sign in to comment.