hi! im new to this whole coding thing (first day actually) and i was wondering how you would tell an object not to go through a platform when jumping. any suggestions?
private void platform_move()
{
setLocation(getX() + x_speed, getY());
}private void player_move()
{
[platform actor name] moving_platform = ([platform actor name) getOneObjectAtOffset(getX(), getY()+getImage().getHeight()/2, [platform actor name]);
if(moving_platform != null)
{
platform_x_speed = moving_platform.x_speed;
}
else
{
platform_x_speed = 0;
}
if(Greenfoot.isKeyDown("right"))
{
x_speed = 1;
}
if(Greenfoot.isKeyDown("left"))
{
x_speed = -1;
}
setLocation(getX() + x_speed + platform_x_speed, getY());
}