Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
I'm creating a dice game where the first one that reaches number 25 wins, but I can't make it when I get to 25 to score the winner

there is the example http://luislalo.com/game/

get the tabs direction

function getDirection(){
    let direction
    if((margenIzquierdo()==-39.2 && ((((margenArriba()*10)%(-19.6*10))/10)==0))
    || (margenIzquierdo()==0 && ((((margenArriba()*10)%(-19.6*10))/10)!=0))){
        direction = 'up'
    }
    else if((((margenArriba()*10)%(-19.6*10))/10)==0){
        direction = 'left'
    }else{
        direction = 'right'
    }

    return direction
}

I think the problem is here where i check the win and check the range, but i don't know why

function checarVictoria(){
    if(margenArriba()==-39 && margenIzquierdo()==0){
    document.querySelector('#p_turno').innerHTML = `${turno} ¡Player wins!`
    new Audio('win.mp3').play()
    return turno
}

else{
    return 'none'
}
}

check the range

function checarRango(dadoNum){
    let fueraDeRango = false
if(margenArriba()==-39.2 && (margenIzquierdo()+Number((dadoNum*-9.8).toFixed(1)))<0){
    fueraDeRango = true
}
return fueraDeRango
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda