Is it possible to have a different hotspot on same part of room

Started by Jojowl80, Thu 28/05/2020 02:24:04

Previous topic - Next topic

Jojowl80

I made a closet door that opens and when it opens I added an object to show the door open with new objects behind it. Now I dont see a way to interface with the new items. is this even possible?

Crimson Wizard

Make the door unclikable after it opens (myObject.Clickable = false). Or, if you still want to be able to close the door, move it aside (depends on how it's opening) by setting new X and Y coordinates.


Khris

My 2 cents:
Try to model your game world after how the real world works: draw the closet without doors as part of the (immobile) background, then use an object to show the closed door. Interacting with that door will change its .Graphic (and position, unless you draw the sprites in a way the hinges are at the same spot in both sprites). Transparent areas of objects don't catch clicks, so you can now interact with objects behind the door object.

Jojowl80

so forgive me as I have been only doing this for 2 days, but here is the code I have so far


function oClosetdoor_AnyClick(){
if (Verbs.UsedAction(eGA_WalkTo)) {
}else if(Verbs.UsedAction(eGA_Open)) {

{oClosetdoor.Move(64, 85,  eBlock);
oClosetdoor.Clickable = false;
}
}}


Game starts,but the closet door does not visibly move to the desired location. Also it might be worth noting that the door slides slightly to the left, not on "hinges"

Khris

Check the parameters again, the 3rd is speed. Try something like

Code: ags
  oClosetdoor.Move(64, 85, 4, eBlock);

Jojowl80

well Its working now, thanks for all the help, and thanks for the speed tip!

SMF spam blocked by CleanTalk