Hey, I currently have two ships chasing each other around each sending packets containing their rotation and position along with a "hasFired" bool.
Now, if this bool is true, the main game code fires missiles from the origin ships position. I can't seem to get this to work as a once off event i.e: if the other player fires, it fires one missile until the next time. I can, however, set the boolean to true and leave it that way which allows me to watch the other ship fire lots of missiles. The other problem I'm having is that the missiles are client side, which means that the missile only needs start point and the rest is drawn and positioned by the client machine. It seems as though they both fire at different times, I press fire and missiles stream out my ship, but on the other machine, it doesn' thappen at exactly the same time. I have the game updating network data every six frames.
Basically what I need to know is, how can I ensure that when I press fire, that a once off fire event happens and is recognised by the remote machines and that it fires the same frame? Can I make it send an update instantly?
I'm using the tanks prediction sample as a base.