Hey guys! I am back with another question! First of all I would like to say thank you so much for all of the input and help so far that I have received!
Okay so I will try to be brief with this one… Basically I have a world, a hero, and blocks. I have speed, gravity and friction all accounted for and working. I added a grass block for the ground and all hell broke loose… lol. Here is how I was handling just the ground prior to changing it out for the grass.
if (collide("wall", x, y + 1))
{
ySpeed = 0;
isJumping=false;
if (Input.check(Key.SPACE))
{
ySpeed=-jumpPower;
isJumping=true;
}
}
I then had this one liner at the end of my conditionals:
moveBy(xSpeed, ySpeed, "wall");
This all worked like a charm. As soon as I tried adding some AND and OR’s pointing my game to the “grass” type it worked to an extent, but for some reason, my hero clips under the grass a few pixels. It is rather annoying and I am certain that it is because I am not giving it any moveBy information, but as soon as I do, the character runs SUPER fast. lol
So what do you guys think? How can I add the grass to the ground and still have it act like the walls aka blocks which simple just keep the hero from leaving the level and don’t allow the player to clip inside of them?
Thank you in advance!