How to create platformer enemies?

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.
  • Hey everyone.


    I know I made a post similar to this in the past but this one is different.

    I'm looking to create enemies that have gravity and will switch directions once they bump into a wall.

    I need to have it so the enemies will walk on objects and change directions upon walking into them.
    Preferably, I'd also like to give them gravity with acceleration (a Grav value with 0.1 always being added).

    I followed this guide and managed to make enemies: Please login to see this link.

    The only problem is I can only make the enemies walk and bounce off of either actives (each given the qualifier Obstacles) OR backdrops. One or the other.

    I really need to find a way to make this work seamlessly for both colliding with actives AND backdrops, as I want my game to be capable of having animated floors, while having backdrop floor objects to keep things simple (such as having less icons in the event editor or saving CPU usage [I think]).


    Any ideas? :)

  • Well..... I 'WAS' going to show you this tutorial
    Please login to see this link.
    However, the disclaimer on that site says that method no longer works as of the current CTF version. Even though it gives somewhat a decent platformer enemy example.
    Other tutorials I found from google search:
    Please login to see this link.
    Please login to see this link. - From almightyzentaco, and this person makes really impressive tutorials too. :)

  • Well..... I 'WAS' going to show you this tutorial
    Please login to see this link.
    However, the disclaimer on that site says that method no longer works as of the current CTF version. Even though it gives somewhat a decent platformer enemy example.
    Other tutorials I found from google search:
    Please login to see this link.
    Please login to see this link. - From almightyzentaco, and this person makes really impressive tutorials too. :)

    I got the first tutorial working but once I replace the events to check for the goomba to be to overlapping the obstacle qualifier instead of a backdrop, the goomba's physics break.
    For example, If goomba 1 is in the air and goomba 2 is higher in the air than goomba 1 and goomba 1 has landed on a obstacle qualifier, goomba 2 will stop falling and continue walking horizontally through the air. Works perfectly when using backdrops though.

    And also thanks for the links, but the first tutorial is a bit too simple for what I'm looking to do as I plan to create a lot more objects based off of the events I'm looking for to give the goombas physics.
    And as for the second tutorial, I can get it to work but again once I implement events so it does the same for obstacles (not backdrops), the above problem happens once again.


    Also for reference, I believe the tutorial still works. They claim it's broken as Clickteam released an update, but to my knowledge it only broke the animations of the goomba's when using the embedded collision detectors method.
    The fix to the animations is to go to the properties (in the bottom left) of the goomba object and go to the 'RunTime Options' tab. At the bottom, check 'Do not reset current frame duration when the animation is modified.'

    Thanks for the directions though :)

  • Sure thing.

    There's probably a better way, or multiple ways to make them do what you need them to do. But those are just a few tutorials to do it. I haven't really looked into it myself, but I'm sure it can be done as long as that method works. :)

    I tested and the method works generally but whatever I do I just can't seem to make the collisions based off of both backdrops and actives. I can only choose one or else the goomba breaks. :O

  • Maybe would a fast loop help? Perhaps detect which goomba to use by adding a spread value of each goomba on the field. Then do a fast loop to check which ID is closer to a backdrop? When that goomba hits a backdrop to check for which ID that goomba is, and only turn that goomba around.

  • Maybe would a fast loop help? Perhaps detect which goomba to use by adding a spread value of each goomba on the field. Then do a fast loop to check which ID is closer to a backdrop? When that goomba hits a backdrop to check for which ID that goomba is, and only turn that goomba around.

    Maybe.
    How exactly would I go about that in the event editor? My goomba currently have a value called "ID" and value 0 is spread at the start of frame. The rest I'm not too sure how to do.

    Also, for the record my goombas events are basically the exact same as the second tutorial by almightyzentaco.

  • Aha I've been trying all sorts of methods all day to be honest and I'm getting a variety of results. Each time though it leads to me having to make a choice of either an obstacle or a backdrop which is frustrating as the .mfa files I looked at had events that worked for both :/

  • I managed to get enemies working that collide with backdrops and obstacles, and they currently use embedded collision detectors.

    This is, fine but I'm wondering if I should and how would I give these goombas a seperate object that will be used for collision detection.

    I know I'm going to need to spread a value for ID for both the goomba object and the detector object, but I'm not sure if this may desync the detectors from the goombas as I will be creating and destroying goombas during runtime.

    Is there any necessary steps I will need to take to ensure the detector always had the same ID value as the goombas it's creating for and is used for its collision?

    I wish to switch over to using seperate objects for enemy collision as I'm not a fan of using the 'FrameSave' value and constantly adding 1 to it to change which animation frame the enemy is playing.

  • You can simply use 1 detector active (instead of one per enemy). You just run a fastloop every time collision is needed and place the detector at the position of the enemies, one at a time. Then, within the fastloop, you check your overlap conditions. When the loop is done, reposition the detector outside the frame so it won’t interfere with anything.

    Please login to see this link.

  • You can simply use 1 detector active (instead of one per enemy). You just run a fastloop every time collision is needed and place the detector at the position of the enemies, one at a time. Then, within the fastloop, you check your overlap conditions. When the loop is done, reposition the detector outside the frame so it won’t interfere with anything.

    I'll try that tonight. Thanks!

Participate now!

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