help me with this script it doesnt work i get alot of errors like:
error CS0246: The type or namespace name ‘SDL_Event’ could not be found (are you missing a using directive or an assembly reference?)
public class Jump : MonoBehaviour{}
public partial class Player
{
public void HandleEvents(SDL_Event @event)
{
if (@event.type == SDL_KEYDOWN)
{
switch (@event.key.keysym.sym)
{
case SDLK_w:
if (!jumping)
{
jumping = true;
}
break;
}
}
//Implementation
if (jumping)
{
yPos -= yVel;
yVel -= gravity;
}
else
{
yVel += 2;
}
}
public bool CollisionWithGround()
{
if (yVel > 0)
{
return true;
}
return false;
}
}
public partial class Game
{
public void Logic()
{
//Collision with floor
if (player.CollisionWithGround())
{
player.yVel -= 2;
player.jumping = false;
}
player.yPos += player.yVel;
}
}