How to make a character unseen (SOLVED)

Started by BlueAngel, Sun 06/02/2011 12:39:10

Previous topic - Next topic

BlueAngel

Hi
I have a character (cboar2) behind a rock and I don’t want the player to know it’s there before he finds it. But if you have the mouse over the rock the action label tells you it’s there.
What to do?
This is my code:

Code: ags

function room_RepExec()
{
bool found;
int x, y;
  if(BoarOut==0)
  {
    cBoar2.Transparency=100;
  }
  else if(BoarOut==1)
  {
    cBoar2.Transparency=0;
  }
  if(!cBoar2.Moving){
  while(!found){
    x=Random(Room.Width);
    y=Random(Room.Height);
    if(Region.GetAtRoomXY(x,y)==region[2])found=true;

  }
  cBoar2.Walk(x, y, eNoBlock, eAnywhere);
}
}

Wyz

What you could do is set the 'Clickable' property of the boar initially to false.
As soon as theplayer has found it you'd set it to true:

Code: ags

// ...
cBoar2.Clickable = true;
// ...
Life is like an adventure without the pixel hunts.


SMF spam blocked by CleanTalk