Need help making 'Solid' behaviour conditional with multiple moving objects

  • Hi all,

    I'm making a crazy top down action RPG-type game, in the Link To The Past-type mould.

    I would like the game to have small platforming elements, involving jumping, heights, swimming and so on.

    I am using the 8 Direction Movement for the main character, and I have successfully made it so that the character can 'fly' over solids but gets stuck if he tries to approach them from the side.

    (If 'Main Character Altitude' is higher than 'Solid Altitude', disable solid, and reenable when it's lower... simple!)

    The problem is, I want to make this system function for every moving character on screen (enemies, animals etc). In this case, enabling or disabling solids doesn't work because they need to function for a variety of characters at a variety of heights. For example, if the main character sails over a solid, an enemy whose altitude is much lower should be prevented from passing, but because the solid is universally disabled, the enemy can pass through as well.

    I have tried programming in a simple 'On Collision, Stop' command in events, but the 8 Direction movement, the Bullet bounce function... whatever I try, it doesn't work. There is no command that 'On X & Y collision, don't let X pass through Y' - it simply slows down X a bit and then lets it go through anyway.

    Any ideas for a workaround?

    Thanks in advance!

    TLDR: I want to make solids 'Solid' for some objects and 'Not Solid' for others... at the same time, depending on which objects are higher 'Altitude'.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Conditionally disable solid on the player/enemy instead of the obstacle?

  • Or set an instance variable to every character/enemy/obstacle height, so that you can compare to enable or disable solid.

    IF

    System compare two values: Character.Height > Obstacle.Height

    THEN

    Character set solid disabled

    And by my very little experience, if no physics involved nor a proper platformer, I'd use XY position conditions rather than collision or overlap.

  • Thanks for your help with this! I was quite keen to use some of the physics- bullet for characters getting knocked backwards etc- so would definitely prefer to find a solution that uses aspects of the built-in systems. The only thing with characters being solid is they will then interact with other characters and unwanted collisions will happen...

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