Platformer Monster Walking

  • I'd like to make each monster in my game work as described in this tutorial: scirra.com/tutorials/828/ad ... ies/page-3

    However, this only applies to one monster. How do I use this for all monsters separetely? I've managed to apply the logic to all monsters at once, but they ALL turn when only one is at the edge of a plaftorm.

    Thanks!

  • I notice in that tutorial there is nothing that tells the monster which detector to use, so I guess what's happening is the logic sees that a detector is failing to collide with the ground, and then issues a command to turn around to ALL monsters. The tutorial seems to assume you only ever have one monster and one detector, but since I didn't try building it myself I might be mistaken about something here.

    You could try using a Container to automatically spawn the monster and a detector at the same time. That way each monster instance will have its own detector instance. It should be easy to try out, and might just work without further changes to your events. If you haven't used containers before, they are explained in the manual here:

    https://www.construct.net/make-games/ma ... containers

    There are some tutorials out there for them too, I'm sure. Good luck!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I notice in that tutorial there is nothing that tells the monster which detector to use, so I guess what's happening is the logic sees that a detector is failing to collide with the ground, and then issues a command to turn around to ALL monsters. The tutorial seems to assume you only ever have one monster and one detector, but since I didn't try building it myself I might be mistaken about something here.

    You could try using a Container to automatically spawn the monster and a detector at the same time. That way each monster instance will have its own detector instance. It should be easy to try out, and might just work without further changes to your events. If you haven't used containers before, they are explained in the manual here:

    https://www.construct.net/make-games/ma ... containers

    There are some tutorials out there for them too, I'm sure. Good luck!

    Yep you got it. Also I think all of the detectors are attached to the one monster. Event 1 seems to imply that every detector you spawn would be set to the one monster object with the lowest UID. So when detector is not overlapping, move the monster, well all the detectors are in the same place and all it takes is for that overlap to stop happening to affect all enemies. It's not a fantastic tutorial as it doesn't explain or utilise picking, the detector sprite does not relate to its own monster and breaks if you add more than one monster (you would expect more than one to be on screen in the classic style game he is describing). If you are going to do monster walking in this style then you would need to put detector in a container with the monster as you mentioned, or relate them to each other in another way such as matching IDs or variables. I would do it a different way though, have 'sensors' at the end of platforms that send the enemy in the opposite direction on collision.

  • .....I would do it a different way though, have 'sensors' at the end of platforms that send the enemy in the opposite direction on collision.

    This is exactly the way I have always done it!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)