All that it takes is to put yvelocity=0; after the if-else clause that checks for the ceiling. Now, no matter how fast you jump, there is no getting stuck.
The code gets better and better!

lverona wrote:I am now thinking over - how to work moving platforms? I haven't tried horizontal platforms, but with vertically moving platform there is a following problem: when the platform is moving DOWN and you are jumping on it from top, then the player never lands on the platform, but keeps touching it, then being pushed back, then falling and touching it again, then pushed back. The only way when the player can actually land on the vertically moving platform is when it moves UP.
This basically brings up the need for a certain function that would recognise the collision with an object, but not act as an actual collision. Meaning that one can have areas defined that would react to the player touching them, but at the same time being CollisionState disabled.
If there is such a function, I would really like to know, since it is crucial for a CollisionFree approach, otherwise it becomes very difficult to make the player interact with the environment other than bumping into it.
Here's an example: I want to pass a wire frame and by that action trigger a sound.
With a PhysicalReponse approach I can do this by just registering a collision. Not issuing a Physical Reponse I play a sound.
With a CollisionFree approach I cannot really do this. If I set wire frame to CollisionState=DISABLE, then it simply ignores any collision event at all.
So this is the fundamental problem here which needs a solution
I mentioned this problem in one of the many topics about this method that have popped up.
happyjustbecause wrote:So there isn't currently a way to do something like you explained (wire frame)? That seems to be a large issue, what do you think of this collision method skydereign?
happyjustbecause wrote:Do you think this is a good method for collisions, it at least looks very nice to me, but if there are large problems with it, I don't know if I should use this one over another one I could maybe use. I want to rework the collision method I have, but I want to use the best one possible, at least the best one at my current skill level.
phyzix5761 wrote:Having a problem with this method. When the top of the player hits the bottom of a block his xvelocity becomes 0. I don't want this to be the case because I am not working with gravity. I am working on a top down game. How can I change this?
int CollisionFree2(char* clonename, int x, int y, char* actorList ...);
if(CollisionFree2("Event Actor", x, y, "ground", "walls", "other")==1)
{
// do something
}
Users browsing this forum: No registered users and 1 guest