Open and close window

Started by Candle, Fri 05/11/2004 01:21:09

Previous topic - Next topic

Candle

I'm having a click on the window to open but not sure how to have it closed if clicked on again ?
Would you hide the first hotspot  and show the 2 hotspot  and then repeat ?

Goot

If you have 2 separate objects for open and closed, each object turns itself off, and the other one on. If you have one moving object, set a variable for whether or not the window is open.

Candle

Anyway to do it with DD ? (drag&drop)

Edwin Xie

He means that you have two separate objects: one an open window and another a closed window. You would have to have sprites on it and yes, to move objects it is drag and drop. Try to figure out a script. I may help you tomorrow on the script though.
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Ashen

This is what I've used for opening/closing a drawer, it should work for you too:
Code: ags

// Where ever you want is triggered from (Object interaction or Hotspot interaction)
if (GetObjectGraphic (0) == xx) { // where x is the sprite number of the 'open window' graphic
Ã,  AnimateObjectEx (0,0,3,0,0,1); // You could use AnimateObject, but I wanted it blocking.
}
else if (GetObjectGraphic (0) == yy) {// where yy is the sprite number of the 'closed window' graphic
Ã,  AnimateObjectEx (0,0,3,0,1,1); // runs the loop backwards
}


Check the parameters for AnimateObjectEx (..)to make it run how you want (e.g. delay, blocking)
I know what you're thinking ... Don't think that.

Candle

Thank you all try to get this to work .

SMF spam blocked by CleanTalk