From: Clyne Sullivan Date: Wed, 9 Dec 2015 13:28:39 +0000 (-0500) Subject: npc facing X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=4e3ceb550b26e3b7810b4493943db98918d7bef1;p=clyne%2Fgamedev.git npc facing --- diff --git a/src/entities.cpp b/src/entities.cpp index f2d7270..08af0a9 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -313,6 +313,10 @@ void NPC::interact(){ //have the npc's interact back to the player if(aiFunc.size()){ func=aiFunc.front(); canMove=false; + + left = (player->loc.x < loc.x); + right = !left; + if(!func(this)){ if(aiFunc.size())aiFunc.erase(aiFunc.begin()); }