Skip to main content
added 10 characters in body
Source Link
Valamorde
  • 427
  • 1
  • 8
  • 23

I am creating a browser game that allows players to fight monsters using Nodejs, Socket.io and Express. However I can't seem to figure out how to implement the turns of combat.

My train of thought and workflow is as follows:

  • The player declares an attack on a monster (Client makes a Post request.) - Working

  • The server get's the player's stats as well as the monster's. - Working

  • The player selects his action and attacks, then it's the monster's turn and so on. - Can't figure this out

How would such a functionality be implemented?

I am creating a browser game that allows players to fight monsters using Nodejs, Socket.io and Express. However I can't seem to figure out how to implement the turns of combat.

My train of thought and workflow is as follows:

  • The player declares an attack on a monster (Client makes a Post request.) - Working

  • The server get's the player's stats as well as the monster's. - Working

  • The player selects his action and attacks, then it's the monster's turn. - Can't figure this out

How would such a functionality be implemented?

I am creating a browser game that allows players to fight monsters using Nodejs, Socket.io and Express. However I can't seem to figure out how to implement the turns of combat.

My train of thought and workflow is as follows:

  • The player declares an attack on a monster (Client makes a Post request.) - Working

  • The server get's the player's stats as well as the monster's. - Working

  • The player selects his action and attacks, then it's the monster's turn and so on. - Can't figure this out

How would such a functionality be implemented?

Source Link
Valamorde
  • 427
  • 1
  • 8
  • 23

Implementing Turn based Combat Using Node js

I am creating a browser game that allows players to fight monsters using Nodejs, Socket.io and Express. However I can't seem to figure out how to implement the turns of combat.

My train of thought and workflow is as follows:

  • The player declares an attack on a monster (Client makes a Post request.) - Working

  • The server get's the player's stats as well as the monster's. - Working

  • The player selects his action and attacks, then it's the monster's turn. - Can't figure this out

How would such a functionality be implemented?