Today, I fixed a major bug on the Mapper, where it wouldn’t allow the NumberDecimalSeparator to be written in a textbox. Not anymore. I also fixed a bug where the player colours were messed up, on regular Deathmatch they were always getting red instead of neutral (red is the default color for Team A, blue being Team B, etc).
Bug fixes apart, I started writing the bullet code. For now, the player can shoot when the left mouse button is released after it was pressed (basically a mouse-up action). The client doesn’t check for firing rates nor reload checking, and the bullet is created and sent to the server.
The server reads the bullet and basically sends it to all clients in-game. The game reads the packet and it sorts it all out. The bullet is then updated regularly.
The collision checks are also mostly complete: it disappears when outside the bounds of the map, when crashing against a tile or when crashing against all players except for the “bullet owner” (who shot it). Only thing that is missing is when checking against the players… basically the client will send a packet to the server indicating the bullet hit a teammate/enemy so it can do game logic: confirming if the player was really in the spot, checking if it hit a teammate, if team-killing is on, and so forth, and then do the corresponding action.
It’s pretty stable and fast, doesn’t crash either instances (server nor client), and the lag doesn’t seem to play a major factor. The only factor I can think of is during collisions: if player positions are behind, the hitboxes are probably not going to be accurate. But that happens in all games, right?
Anyway, besides server game logic, I’m also lacking a weapon selection system. I’m probably going to have an array of weapons available with default settings, and the server will be able to tweak/disable weapons accordingly. As for which weapons will be available, I’m not going to discuss it now, mostly because not even I know that. For now.
Also, each bullet has its own light. But they’re not like in the video below, where I was purposely testing out the lighting engine… they will be weaker and have different color tones according to the weapon. So don’t freak out.