Added basic server reconcilliation

This commit is contained in:
2023-08-03 00:15:44 +01:00
parent 663199f3e4
commit e544b01ef1
3 changed files with 86 additions and 4 deletions

View File

@ -1,5 +1,7 @@
#include <stdio.h>
#include <stdint.h>
#include "cspt-state.h"
void updateInput(struct gameState * state, struct clientInput * message)
{
if(message->clientNumber < 16 && message->clientNumber >= 0)
@ -49,6 +51,7 @@ void doGameTick(struct gameState * state)
{
state->clients[index].yVelocity *= 0.9;
}
// Do movement:
state->clients[index].xPosition += state->clients[index].xVelocity;
state->clients[index].yPosition += state->clients[index].yVelocity;