How to make a mario style enemy?

0 favourites
  • 5 posts
From the Asset Store
Slot Machine Games. suitable for workers who work from home because it has player names that must be played alternately
  • 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.

  • 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?

  • 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?

  • 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)