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

202
Visualizações
Having multiple 'states' in a game using Socketio and Nodejs

I'm trying to make a casino game called crash. In this game users must simply crash out before the a counter reaches a random multiplier. A game looks like this; first of all users will be able place bets in a ten second period, then have a counter go on in which users can "crash out" and finally have it crash at a random value and repeat the process.

I'm trying to to this with socket.io. However, I'm struggling at two things. First of all how can I make several states (betState, countState and crashedState) and make these specific to a task. Therefore in the betstate the placeBet function should be active, in the countState users won't be able to place a bet and be able to crashOut and ultimately in the crashedState it just shows a message that it's crashed. How can I make these 'tasks' easily run on the server, and is there an example I can look into?

about 4 years ago · Santiago Gelvez
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