Skip to content

Commit

Permalink
ao final das linhas pula para a proxima palavra
Browse files Browse the repository at this point in the history
  • Loading branch information
fereinaux committed Apr 15, 2022
1 parent 9acb59e commit 6d7e04c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const funcNextRow = () => {
timeInterval = (time / 1000) - 1
$('.time-mark').text(timeInterval)
}
let timerSecond
let timerSecond
let timerNextRow

$.get(`/palavras.json`, function (data) {
Expand Down Expand Up @@ -66,7 +66,7 @@ const changeWord = () => {
currentRow = 0;
currentColumn = 0;
guesses = [];
word = words.filter(word => usedWords.indexOf(word) < 0).sort((a,b) => a.length - b.length)[0]
word = words.filter(word => usedWords.indexOf(word) < 0).sort((a, b) => a.length - b.length)[0]
$("#tips-list").empty()
$(".tile-container").empty()
letreco = word.replace('ç', 'c')
Expand Down Expand Up @@ -113,11 +113,15 @@ const changeWord = () => {
}

const skipRow = () => {
let currentColumns = document.querySelectorAll(".typing");
for (let i = 0; i < currentColumns.length; i++) {
currentColumns[i].classList.add("skipped")
}
moveToNextRow()
if (currentRow < rows - 1) {

let currentColumns = document.querySelectorAll(".typing");
for (let i = 0; i < currentColumns.length; i++) {
currentColumns[i].classList.add("skipped")
}
moveToNextRow()
} else
changeWord()
}

const getTip = (skip) => {
Expand Down Expand Up @@ -178,7 +182,7 @@ const checkGuess = () => {
moveToNextRow()
}
} else {
points += ((6 - currentRow)+ letreco.length) * 10
points += ((6 - currentRow) + letreco.length) * 10

usedWords.push(word)
localStorage.setItem('usedWords', usedWords)
Expand Down

0 comments on commit 6d7e04c

Please sign in to comment.