C0rupted / Vitrix

An open source FPS video game coded in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiplayer issue: Players don't take damage

C0rupted opened this issue · comments

The title just explains it. On client-side, it appears as if the player is taking damage, but the player on the other client isn't receiving the damage.

I have finally found a fix to the issue, actually not just one, but multiple bugs were linked to this problem. First of all, the bullet entity wasn't rendering on the other player's side, this is mainly because the bullet object wasn't being sent after it was shot. Also, the send_health function in network.py wasn't working because the Network class instance made at runtime wasn't being passed through to the Bullet class. Also, some code had to be added to the receive() function in multiplayer.py because it wouldn't update the healthbar as well, but after that, it works now, and is actually working faster than previously, so as a bonus the commit will also add some performance improvements as well, commit coming soon!

I just noticed that the fullscreen button isn't being shown in the pause menu either, so that's coming with the commit!

Just made commit! Closing issue...