monster face direction question

WillElm

New member
So far, my monsters have only ever faced left. Some of them change direction when the player jumps over, some of them change direction when they hit a wall. But they all moonwalk when they do this!

I know you probably use the FaceDirection macro to make them actually turn around, and that the first argument selects the object and the second argument selects the specific direction. I don't even know what to put instead of player1_object. Is it a #$ number?

I'm thinking you could put FaceDirection (enemy object), FACE_RIGHT in the AI movement script and probably the reverse direction solid object reaction. But then of course you have to make them turn back around.

So

If moving left, face left
if moving right, face right

How have y'all handled this?
 

dale_coop

Moderator
Staff member
Is it an issue or a new behavior you want to implement...?

If it's an issue...
Are you sure you set correctly your monster animations (in "Object Details")?
Because, personally, the default facing are always correct for me.
My monster walks left, he's facing left
when he walks right, he's facing right
when he "reverses direction" (on solid/edge collision) he's facing the direction he's now walking.
etc...

If you want a turn back direction, there is actually a TurnDirection.asm AI script.

And to reply directly to your question, for an AI script or solid/edge reaction script, the 1st parameter for FaceDirection would be:
Code:
	STX tempx
	FaceDirection tempx, FACE_RIGHT
 

WillElm

New member
:oops: you could call this a big brain fart, big enough for me to post a thread. I had simply not set up the animations for the monsters. I haven't messed with anything like that in probably 6 weeks, and have been spending most of my nesmaker time either reading here or messing with asm. At some point my brain had decided that the turning code happened in the ai scripts. I think it's because I had seen the face direction macro so many times in the player movement scripts that I just forgot all about the the first tab of the object details screen.
 

dale_coop

Moderator
Staff member
No problem, I did some similar mistakes a lot at first (still now, sometimes... Shhhh...)
:p
 
Top Bottom