Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!