T
TheRBZ
Guest
I have a simple button object set up that controls buttons. Some are simple, just go to a room.
Some are like options and need to run through a set of options
(e.g. Start on normal, go to hard, then go to easy then to normal, and cycle).
My current code is bulky and I'm sure there is a more efficient way.
In each instance creation code, it has this template:
It basically determines which piece of code is assigned to which instance.
If you look at case 3 and 4, you see my attempt at making a run through multiple options.
IS there a more efficient way of doing it?
Also, if you need to see more code with the objects and instances, just say.
Some are like options and need to run through a set of options
(e.g. Start on normal, go to hard, then go to easy then to normal, and cycle).
My current code is bulky and I'm sure there is a more efficient way.
Code:
switch(action)
{
//Speedrun button
case 0:
room_goto(rm_speedrun);
break;
//Versus button
case 1:
room_goto(rm_versus_set);
break;
//Disinfect Button
case 2:
room_goto(rm_disinfect_set);
break;
//Disinfect mode button
case 3:
if inst_10C4A282.text = "Normal"{
inst_10C4A282.text = "Experimental"
global.dis_mode = "experi";}
else{
inst_10C4A282.text = "Normal"
global.dis_mode = "normal";}
break;
//Disinfect difficulty button
case 4:
if inst_6CEA83E2.text = "Normal"{
inst_6CEA83E2.text = "Hard"
global.dis_dif = 999}
else if inst_6CEA83E2.text = "Hard"{
inst_6CEA83E2.text = "Easy"
global.dis_dif = 5499}
else if inst_6CEA83E2.text = "Easy"{
inst_6CEA83E2.text = "Normal"
global.dis_dif = 3499}
break;
//Versus mode button
case 5:
break;
//Versus time button
case 6:
break;
}
Code:
text = "[first shown text]";
action = [action #];
If you look at case 3 and 4, you see my attempt at making a run through multiple options.
IS there a more efficient way of doing it?
Also, if you need to see more code with the objects and instances, just say.