SOLVED: Hovering mouse changes a character

Started by Ginger_till_i_dye, Sat 22/08/2020 18:21:52

Previous topic - Next topic

Ginger_till_i_dye

Ok so I'm doing a first person game and am really stuck on how to go forward :(
the scenario is:
there's a bone (object label oBone) being guarded by a dog (character label cDog)
I want the dog to start growling when the mouse hovers over the bone
(graphics currently set up so normal is direction up and growling is right)

I tried looking for collisions
I tried
Code: ags

function room_RepExec()
{

  Object *oat = Object.GetAtScreenXY(mouse.x, mouse.y);

if (oat == oBone)
{
  
  cHound.FaceDirection(eDirectionRight);
  }
  else
  {
    cHound.FaceDirection(eDirectionUp);
    }
}


but that just had the dog growling constantly :(

Can some one point me in right direction please?

EDIT: I'm a freaking moron who had the growl graphic set to down not up - works fine once I changed eDirectionUp to eDirectionDown

SMF spam blocked by CleanTalk