Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Mirror in 2d  (Read 4369 times)

0 Members and 1 Guest are viewing this topic.

Banky

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
    • View Profile
Mirror in 2d
« on: April 27, 2006, 09:48:09 AM »

Hi all

I want to make a room with a mirror in a 2d game. Any ideas on how to do that the actor reflects on the mirror?

Thanks in advance,
-Banky
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Mirror in 2d
« Reply #1 on: April 27, 2006, 10:42:46 AM »

For example you could load a second actor, create an inaccessible area of the scene "behind the mirror" and redirect all GoTo calls to the second actor with appropriately mirrored coordinates.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Banky

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
    • View Profile
Re: Mirror in 2d
« Reply #2 on: April 27, 2006, 11:59:19 AM »

Ummmm... yes, it's a good idea, but how can I manage the "reverse view"? I mean, if the actor is facing the mirror, maybe we will see the back of the actor, but in the mirror we will see the front of the actor...

I don't know if I explained myself very well  :P

Thanks
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Mirror in 2d
« Reply #3 on: April 27, 2006, 12:12:57 PM »

Well if you mirror the GoTo coordinates, the two actors will walk to opposite directions.
Of course, this approach will never be 100% bullet-proof, because there are many actions the actor can perform. Turning, playing animations, talking etc., so the mirror will always be just an approximation. But you could for example employ a script which would be periodically checking actor's direction and setting the opposite direction to the mirrored actor.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Banky

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
    • View Profile
Re: Mirror in 2d
« Reply #4 on: April 27, 2006, 03:59:51 PM »

OK

Thank you for the info, Mnemonic
-Banky
Logged
 

Page created in 0.04 seconds with 19 queries.