Turning Around To Look at the Player (SOLVED)

NickamonPoppytail

  • Posts: 1141
Quote


Wicked Batwingz- He has the simplest mechanic out of every character in the game. He will stand in one place, turning around to watch the player wherever they are. He will never move from this place, and will kill you on contact.

I am having issues with programming this character for Pixeltail. I want him to look like he is turning around to face you, but I cannot get it too look natural. Either I can get him to use his up and down animations, but not his left and right, and vice-versa.

Any suggestions?

« Last Edit: September 09, 2018, 02:47:21 am by NickamonPoppytail »
Upcoming Projects
Poppytail 5 and Pixeltail: Fifth and sixth main instalments in Poppytail series. A Game About Trimming Hedges: Final Version: An updated version of the original AGATH. One Million: Last-one-standing style small project. The Poppytales: Platformer boss rush with character collecting. Skies n' Fall: Boss rush shooter prequel to Rise n' Brawl. Precious: Weird platformer. Christmas Time 2: Sequel to Christmas Time 1.

letmethink

  • *
  • Posts: 2545
What you could do is choose whether to look left/right or up/down based on how far the player is from each of these axis. Create a Boolean attribute and call it "horizontal* or something like that then in the when updating do this code.

Set horizontal to <(absolute value of ((x of self)-(Alex x)))>(absolute value of ((y of self)-(Alex y))>

If it's true then face horizontally and otherwise face vertically
~Letmethink

NickamonPoppytail

  • Posts: 1141
What you could do is choose whether to look left/right or up/down based on how far the player is from each of these axis. Create a Boolean attribute and call it "horizontal* or something like that then in the when updating do this code.

Set horizontal to <(absolute value of ((x of self)-(Alex x)))>(absolute value of ((y of self)-(Alex y))>

If it's true then face horizontally and otherwise face vertically


Thanks Letmethink! I will try this tomorrow and see if WBW works as intended.
Upcoming Projects
Poppytail 5 and Pixeltail: Fifth and sixth main instalments in Poppytail series. A Game About Trimming Hedges: Final Version: An updated version of the original AGATH. One Million: Last-one-standing style small project. The Poppytales: Platformer boss rush with character collecting. Skies n' Fall: Boss rush shooter prequel to Rise n' Brawl. Precious: Weird platformer. Christmas Time 2: Sequel to Christmas Time 1.

NickamonPoppytail

  • Posts: 1141
Thanks Letmethink! This issue is solved now and Wicked Batwingz functions exactly as I imagined. :)
Upcoming Projects
Poppytail 5 and Pixeltail: Fifth and sixth main instalments in Poppytail series. A Game About Trimming Hedges: Final Version: An updated version of the original AGATH. One Million: Last-one-standing style small project. The Poppytales: Platformer boss rush with character collecting. Skies n' Fall: Boss rush shooter prequel to Rise n' Brawl. Precious: Weird platformer. Christmas Time 2: Sequel to Christmas Time 1.