How do I get the host & peer to reciprocate actions?

0 favourites
  • 1 posts
From the Asset Store
Alot of High Quality Items sound effects for your game!
  • I've been finally dipping my toes into the multiplayer front, and I'm running into a small issue with my turn based tank combat game. I can provide my capx if necessary, but it's a little big and I have tons of custom plugins so I want to avoid that if possible

    The system I have in place is as follows:

    Depending on TankGameState (hostturn or peerturn), the host or peer can click once to shoot a single shell in the direction of the tankbarrel (setting TankGameState to either HostShooting or PeerShooting). If the tank shell collides with the opponent tank, ground, or layout border, it destroys itself and sets TankGameState to either hostturn or peerturn depending on who just played.

    The system works on peerturn for both the peer and host, with the peer's shell showing up and responding on both sides. However, on the host's turn, the host shell appears on the peer's window but not the host window, and the GameState doesn't change to HostShooting like it's supposed to, so the host can shoot as many times as they want and the missiles won't detect the collision with the peer tank (because that even only triggers if the state is HostShooting).

    Here is the relevant code:

    I'd appreciate any help! If you want to peek at the capx, let me know and I'll upload it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)