Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Pilpoilplante on Sun 25/10/2009 22:53:41

Title: Mirror effects (Solved)
Post by: Pilpoilplante on Sun 25/10/2009 22:53:41
Hi everybody!

I just want to know how to make mirror effects? I mean, I have a room with a mirror, and I want the player to see the reflection of the charcater when he moves near it. Can anybody help me, please?
Title: Re: Mirror effects
Post by: TerranRich on Sun 25/10/2009 23:47:58
The reflection has to be another, identical character, and the mirror must be, in essence, a hole peeking through the other side, where the identical mirror character is. Then, have him follow. Look up the Follow() command in the manual. (I think that's what it's called.)
Title: Re: Mirror effects
Post by: Pilpoilplante on Mon 26/10/2009 00:23:13
Ok, thanks a lot, TerranRich!
I didin't knew you could do reflextions folloings in the Follow() command
Title: Re: Mirror effects
Post by: Khris on Mon 26/10/2009 00:58:43
I do reflections by setting the mirror character's coords, loop and frame in the room's repeatedly_execute.

Like this:
  cMirror.x = player.x;
  int wall_y = 150;  // baseline of wall / mirror walk behind
  cMirror.y = wall_y - ((player.y-wall_y)*8)/10;
  cMirror.Frame = player.Frame;
  int l = player.Loop;
  if (l == 0 || l == 3) l = 3 - l;
  cMirror.Loop = l;
Title: Re: Mirror effects
Post by: Pilpoilplante on Mon 26/10/2009 01:07:05
Ok... I understand. Thanks!