How do I create a brick Mario-like enemy?

0 favourites
  • 8 posts
From the Asset Store
Keep dodging the falling bricks for as long as possible.
  • Hi.

    So I'm messing around with different options. I don't know how to exactly achieve this the right way. I want the classic angry brick which is sitting at top and whenever you get close it falls rapidly or make it in a timer, would like to learn both ways.

    I'm not sure which way to go. I could go with MoveTo by rex + Platformer behaviours, I could go with ZigZag by rex behaviour or even Shine. I think there's a few posibilities.

    My question is, which one do you think is the right way to approach this?

    This is the very first aproach I'm taking. Very simple.

    (One problem I'm having is, the Sprite every time it collides with the roof is moving it's X 3 pixels. I can counter this by adding -3 but I would like to know why is this happening.)

    Thanks

  • I think this option would be more useful. https://www.scirra.com/manual/152/turret

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think this option would be more useful. https://www.scirra.com/manual/152/turret

    I really don't follow how a turret behaviour is gonna do properly any of this.

  • Got it. How is the angle of the stone? ex: top-left, bottom .... You can use moveTo and zig-zap for some more random movement.

  • Check this out, Smileh. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    https://www.dropbox.com/s/noldacbvr58kz ... .capx?dl=0

  • I would give your enemy a bullet behavior and work with that. I'd create an invisible collider and place one right above your enemy and another at the bottom, where the enemy hits the ground. The colliders will set your bullet to disabled and change the bullet angle of motion. Have the initial state of your enemy bullet behavior set to disabled.

    When the player is within LOS or reaches the trigger, set your bullet angle of motion to 90 and enable bullet. Have the colliders set your enemy bullet to disabled. So when the brick hits the floor, it stops. There could be many ways to make your enemy go back up. For example, maybe have a separate collider for both the bottom and top. The bottom collider stops (sets bullet to disable) the enemy on collison for X seconds, sets bullet angle of motion to 270 then set bullet to enable. Top collider just sets bullet to disable and sets the bullet angle of motion to 90. Hope this helps!

  • Here, found this example earlier while deep diving through the forums.

    https://www.dropbox.com/s/nc14zsrwrceit ... .capx?dl=0

  • Here, found this example earlier while deep diving through the forums.

    https://www.dropbox.com/s/nc14zsrwrceit ... .capx?dl=0

    Appreciated, but doesn't really do what I expected. I feel the events I have play it better.

    Could someone tell me why the moveto is moving the sprite 3 pixels everytime even if I have set the X to 0 and just move the Y vector?

    Thank you

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