D
Doooooli
Guest
So I'm stuck! I'm trying to figure out how to rewrite this so it does not spam each of these objects each steps! Maybe you can help?
This is my code:
I know that this code that I have now does not deactivate the objects if menubar is false, that's an easy fix! But the problem is when the gui's shown is set to true it's suppose to just spawn 2 objects, and it does, but it spawns those particular objects each step until the game lags out
How can I rewrite this so when obj_menubar_gui.shown = true it will only spawn 2 of those objects and nothing more?
thx
This is my code:
Code:
if obj_menubar_gui.shown = true
{
instance_create(view_xview+450,view_yview+10,obj_menubar_inventory);
instance_create(view_xview+510,view_yview+11,obj_menubar_spelllist);
}
else if instance_exists(obj_menubar_inventory) && instance_exists(obj_menubar_spelllist)
{
}
else
{
if obj_menubar_gui.shown = false
{
instance_deactivate_object(obj_menubar_inventory);
instance_deactivate_object(obj_menubar_spelllist);
}
}
How can I rewrite this so when obj_menubar_gui.shown = true it will only spawn 2 of those objects and nothing more?
thx