Object question

Started by acha1993, Fri 18/01/2008 14:51:46

Previous topic - Next topic

acha1993

I need to set a door as an object, when the character uses it, it shows another object that is an oper door. Everything is OK up to here. The problem is that the character appears behind the object, how can i change things to make my character to appear over objects?

bicilotti

Did you remember to set a baseline for the object? (room editor -> object -> set baseline)

Khris

Also, you don't need to use two objects, you can change the sprite of the object.
Say the door object's scriptname is "oDoor", then in the interact script you'd put:
Code: ags
  if (oDoor.Graphic == 33) oDoor.Graphic = 34;
  else oDoor.Graphic = 33;


Interacting the door will now switch between the two sprites. (Keep in mind that without extra code, both sprites are aligned at the bottom left, so if the door opens to the left, you might have to add a transparent area to the left of the closed sprite and move the object position in the editor.)

acha1993

The baseline help was the solution, thank you.

SMF spam blocked by CleanTalk