How to make a mario style enemy?

  • I cannot figure this out, how can I make a Mario style enemy that just patrols back and forth?

    I want it so that if it is between two objects, when it hits one object it will start moving left and if it hits the other object it starts going right.. and if there is no object at all, just keep going left.

  • Use the platform behaviour

    make sure there is no default controls, then use the "simulate press left" "simulate press right" to control the movement when the enemy hits a trigger point.

    There is a good tutorial on platformers on the main page somewhere.

  • http://www.scirra.com/tutorials/253/how-to-make-a-platform-game/page-7

    Thar you go! even teaches you how to make jumping on their heads work. its a great tutorial I highly recommend it.

  • coltonrawrr - Here's my .capx of my game I'm testing new things on. It's by no means a finished work. But it should show you what you're looking for. When you look at the Event Sheet, scroll to the bottom to find the "Dr Box Movement" group. That's pretty much what you'll find in the tutorial showed you.

    Also, you can use a global variable to track your enemy's direction, but if you choose to limit it to a local variable (as I did - see the Local static text MrBoxDirection = "left" variable declaration at the start of the group), be sure to set the variable to "static" so it doesn't reset its own value every tick (which would override any changes in direction and keep it going the same way indefinitely). Think of static like electricity: it's always ready to be on the move and change. Non-static resets - or is re-declared - ever new tick.

    Does that help? :) Anything we can clarify?

  • Quick question, what is the "PlayerBox" for?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quick question, what is the "PlayerBox" for?Usually acts as hitbox which are for checking collisions. Here is example image:

    <img src="http://www.hitcombo.com/wp-content/uploads/2011/07/street_fighter_hd_remix_hitboxes.jpg" border="0" />

    Those boxes are same type of boxes as "PlayerBox" is and will act as sensor for checking collisions between objects more efficient.

  • Ah, that makes sense, thanks (:

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