Enemy Gravity Collision Problem

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello!

    I am starting a platformer and was having trouble with collision detection for enemies when applying accelerating gravity. I know how to do it with a player (single-object) and fastloops but when trying to make events that would work for groups of objects (many enemies) I can't check precisely, rather only after each movement, causing objects to detect a collision once they're already inside the ground. I attached a picture of my code (it's pretty straight forward I think).

    Please let me know what you think and what I'm missing.

  • With the code I had, it behaved almost the same, but resulting in a "bouncing" effect of 1 pixel while the object tried to fall but then bounced back up above the ground or something odd like that.

    After a good night of sleep I started from scratch, used some flags and nested loops and had a "checker" object loop under each enemy and I got it to work exactly how I wanted it to. I don't know 100% what I did differently (probably just programmed it correctly this time lol) but sleeping on it works! Thanks for the reply!

  • Can you please show an example of how you fixed it? It may prove useful to other having a similar issue.

    The soul of the sluggard craves and gets nothing, while the soul of the diligent is richly supplied -Pro 13:4

  • With the code I had, it behaved almost the same, but resulting in a "bouncing" effect of 1 pixel while the object tried to fall but then bounced back up above the ground or something odd like that.

    After a good night of sleep I started from scratch, used some flags and nested loops and had a "checker" object loop under each enemy and I got it to work exactly how I wanted it to. I don't know 100% what I did differently (probably just programmed it correctly this time lol) but sleeping on it works! Thanks for the reply!

    Yea, i know that feeling

    Glad you got it working:)

    [SIGPIC][/SIGPIC]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!