I am looking at sample code written in C# (whole code can be found here: 2D_Racegame_Zelfstudie: Syncing powerups) and I wonder how to write this with js;
The part I am banging my head up the wall is this public something like function;
public int ApplyPowerUp(PlayerProperties playerStatus)
{
switch(powerUpType)
{
case PowerType.Projectile :
if(playerStatus.playerState == PlayerProperties.PlayerState.CarNormal)
{
Debug.Log("We have a projectile!");
playerStatus.playerState = PlayerProperties.PlayerState.CarProjectile;
playerStatus.hasProjectile = true;
playerStatus.changeState = true;
}
break;
return (int)powerUpType;
}
}
Thank you in advance for your answer!