How to get an enemy to walk

LontaBeans

  • Posts: 200
How can i make a behavior for enemies to walk back and forth? if you know how, i hope you don't mind, but could you use a picture? its easier for me. :(
Skype name: lontabeans (add me)

Hectate

  • *
  • Posts: 4645
There exists behaviors for this already in the collection of pre made behaviors that comes with Stencyl.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

LontaBeans

  • Posts: 200
whats the name of it?
Skype name: lontabeans (add me)

Innes

  • *
  • Posts: 1961
whats the name of it?
It's called '2 Way Horizontal Movement'

If you add a behavior for an actor, it's under the 'Controls' heading and looks like the attached image.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

leechiang

  • Posts: 21
Hi Stencylers,
I'm creating a simple platformer, and having issues with simple left right movement.

I've tried the default baked in 'walking' behavior which moves my character left and right, but the respective animations do NOT play. The 'idle right' -default only plays.

Using '2 way horizontal movement' (as mentioned in this thread) does work playing "idle and walk" animations, but it hurky jerky jumps up when i start walking?! The walking animation does play.

Anyone have similar issues?

ps. I'm wondering if it has to do with the collision box around the character?
Or the fact that my character is built 200px high (in photoshop) but I manually reduce it to 50px inside Stencyl (using the bezier handle to drag it smaller)?

UPDATE:
So I redid my animations making sure that the assets were exact in size, now the character in photoshop is the same and the game play is smoother. The left and right animations do work now. However, there is just a small 'pop' where the character pops up when you do a change of direction.



UPDATE2:
I did what Hectate said in post: http://community.stencyl.com/index.php/topic,13396.new.html#new
that basically said that collisions are the culprit. I changed my collision shapes from rectangles to small circles, putting them by the front of his feet. Now the 'pop' or 'jump' is gone.

« Last Edit: October 11, 2012, 12:04:58 pm by leechiang »

Maldrea

  • *
  • Posts: 1
Okay, I don't get it. I added the behavior "2 Way Horizontal Movement" to my Enemy character. But nothing happens, so now what?

How can I edit this behavior to make the Enemy character simply walk back and forth?

mikbob

  • Posts: 493
There is a simple behaviour called 'Patrol' in StencylForge. What it does it is makes the actor move one way until it reaches a wall, and then it goes the other way. This could be used for walking enemies.

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

captaincomic

  • *
  • Posts: 6108
In the pre-shipped behaviors the ones in the Control category are best suited for the player and they need user input (keys, mouse) to do something. (Okay, you can also use them for AI by triggering custom events.)

For enemies you will usually want the ones from the Motion category, in this case "Back and Forth Horizontally", I think it does about the same thing as the "Patrol" behavior on Forge.